def test_raises_if_patch_does_not_20x(self, api_responses, api_token):
expected_post_url = API_ENDPOINT.format(username=getpass.getuser())
expected_patch_url = API_ENDPOINT.format(username=getpass.getuser()) + 'mydomain.com/'
api_responses.add(responses.POST, expected_post_url, status=201, body=json.dumps({'status': 'OK'}))
api_responses.add(responses.PATCH, expected_patch_url, status=400, json={'message': 'an error'})
with pytest.raises(Exception) as e:
Webapp('mydomain.com').create('2.7', '/virtualenv/path', '/project/path', nuke=False)
assert 'PATCH to set virtualenv path via API failed' in str(e.value)
assert 'an error' in str(e.value)
评论列表
文章目录