Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_pact_files(file_location):
if not file_location:
return []
for filename in glob.glob(file_location):
yield BrokerPact.load_file(filename, result_factory=PytestResult)
def get_pacts(args):
result_log_level = get_log_level(args)
result_factory = partial(CaptureResult, level=result_log_level)
if args.local_pact_file:
pacts = [BrokerPact.load_file(args.local_pact_file, result_factory)]
else:
broker_config = PactBrokerConfig(
args.broker_url, args.broker_token, args.consumer_version_tag
)
pacts = BrokerPacts(args.provider_name, broker_config, result_factory).consumers()
return pacts
def consumers(self):
for broker_pact, pact_contents in self.pact_broker.get_pacts_for_provider(
self.provider_name
):
yield BrokerPact(pact_contents, self.result_factory, broker_pact)