def setUp(self):
super(PactVerifyTestCase, self).setUp()
self.addCleanup(patch.stopall)
self.mock_requests = patch('requests.api.request').start()
self.target = Pact(self.consumer, self.provider)
(self.target
.given('I am creating a new pact using the Pact class')
.upon_receiving('a specific request to the server')
.with_request('GET', '/path')
.will_respond_with(200, body='success'))
self.get_verification_call = call(
'get', 'http://localhost:1234/interactions/verification',
allow_redirects=True,
headers={'X-Pact-Mock-Service': 'true'},
params=None)
self.post_publish_pacts_call = call(
'post', 'http://localhost:1234/pact',
data=None,
headers={'X-Pact-Mock-Service': 'true'},
json={'pact_dir': os.getcwd(),
'consumer': {'name': 'TestConsumer'},
'provider': {'name': 'TestProvider'}})
评论列表
文章目录