def verify_pacts(self, *pacts, **kwargs): """Verify our pacts from the provider. Returns: success: True if no failures logs: some tbd output of logs """ self.validate_publish(**kwargs) verbose = kwargs.get('verbose', False) missing_files = [path for path in pacts if not path_exists(path)] if missing_files: raise Exception("Missing pact files {}".format(missing_files)) pacts = expand_directories(pacts) # rerun_command() # env = success, logs = VerifyWrapper().call_verify(*pacts, provider=self.provider, provider_base_url=self.provider_base_url) sanitize_logs(logs, verbose) return success, logs
def test_verbose(self, mock_write): sanitize_logs(self.process, True) mock_write.assert_has_calls([ call('Actual: {"username":123,"id":"100","groups":' '["users","admins"]}'), call('# /Users/auser/dev/pact-python/pact/bin/pact/lib' '/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.6.0/lib' '/pact/provider_verifier/cli/custom_thor.rb:17:in `start\''), call('# /Users/auser/dev/pact-python/pact/bin/pact/lib' '/app/pact-provider-verifier.rb:2:in `<main>\'') ])
def verify_with_broker(self, broker_username, broker_password, broker_url, **kwargs): """Use Broker to verify. Args: broker_username ([String]): broker username broker_password ([String]): broker password broker_url ([String]): url of broker """ verbose = kwargs.get('verbose', False) success, logs = VerifyWrapper().call_verify(broker_username=broker_username, broker_password=broker_password, broker_url=broker_url, provider=self.provider, provider_base_url=self.provider_base_url) sanitize_logs(logs, verbose) return success, logs
def test_terse(self, mock_write): sanitize_logs(self.process, False) mock_write.assert_called_once_with( 'Actual: {"username":123,"id":"100","groups":["users","admins"]}')