Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

Commit

Permalink
Contract project added
Browse files Browse the repository at this point in the history
  • Loading branch information
eren.anar committed Jul 10, 2024
1 parent 1873bbb commit 278715b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ pip install -r requirements.txt

Consumer testlerini çalıştırmak için:

python tests/shopifyContactProfile.py
python tests/shopifyCreateUser.py
python tests/shopifyIdentity.py
python tests/shopifyTriggerEvent.py
pre-conditions:
go to directory cd tests
export SHOPIFY_API_KEY='paste_current_key'

python shopifyGetSingleProduct.py
python shopifyContactProfile.py
python shopifyCreateUser.py
python shopifyIdentity.py
python shopifyTriggerEvent.py

Provider testlerini çalıştırmak için:

Expand Down
10 changes: 8 additions & 2 deletions tests/shopifyGetSingleProduct.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
from pact import Consumer, Provider
import requests

from global_values import SHOPIFYAPIKEY
import os

# Get API key from environment variable
apikey = os.getenv('SHOPIFY_API_KEY')
if apikey is None:
raise ValueError("API key (SHOPIFY_API_KEY) must be set as an environment variable.")


# Pact konfigürasyonu
pact = Consumer('ShopifyConsumer').has_pact_with(Provider('ShopifyProvider'), pact_dir='./pacts')
Expand Down Expand Up @@ -103,7 +109,7 @@ def test_get_shopify_product(self):

# İstek başlıkları
headers = {
"X-Shopify-Access-Token": SHOPIFYAPIKEY
"X-Shopify-Access-Token": apikey
}

# Pact etkileşimini tanımlıyoruz
Expand Down

0 comments on commit 278715b

Please sign in to comment.