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

Commit

Permalink
contract test - griffin
Browse files Browse the repository at this point in the history
  • Loading branch information
mihribankmrci committed Sep 9, 2024
1 parent 454ac72 commit ab76b5b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
Empty file.
Empty file.
43 changes: 43 additions & 0 deletions tests/verify_provider_internal_query.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import unittest
from pact import Verifier
import yaml
import os

# Config dosyasını yükleyelim
current_dir = os.path.dirname(os.path.abspath(__file__))
config_path = os.path.join(current_dir, "config.yml") # Config dosyasının yolunu doğru ayarlayın
print("Checking config file path:", os.path.abspath(config_path))

if not os.path.exists(config_path):
raise FileNotFoundError(f"Config file not found: {config_path}")

with open(config_path, "r") as ymlfile:
config = yaml.safe_load(ymlfile)

# Config dosyasından gelen ayarlar
# provider_name = config['provider']['name']
# provider_base_url = config['provider']['base_url']
# pact_files_path = config['pact_files']['path']
# broker_url = config.get('pact_broker', {}).get('url', None)
# broker_username = config.get('pact_broker', {}).get('username', None)
# broker_password = config.get('pact_broker', {}).get('password', None)
# consumer_version_tag = config.get('pact_broker', {}).get('consumer_version_tag', None)
# provider_version_tag = config.get('pact_broker', {}).get('provider_version_tag', None)
# enable_ssl_verification = config.get('pact_broker', {}).get('enable_ssl_verification', True)


class ProviderVerification(unittest.TestCase):
def test_verify_provider(self):
# Verifier sınıfı ile provider'ı doğrulayın
verifier = Verifier(provider='InternalQueryProvider', provider_base_url="https://kube-prod-dataforce.useinsider.com/pcd-api")
verifier.verify_pacts('./pacts/internalqueryconsumer-internalqueryprovider.json')

# Pact dosyasını doğrulama işlemi
#success, logs = verifier.verify_pacts('./pacts/internalqueryconsumer-internalqueryprovider.json')

# Doğrulamanın başarılı olduğunu kontrol edin
#assert success == 0, f"Verification failed: {logs}"


if __name__ == '__main__':
unittest.main()

0 comments on commit ab76b5b

Please sign in to comment.