test_pact.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:pact-python 作者: pact-foundation 项目源码 文件源码
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'}})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号