Changeset View
Changeset View
Standalone View
Standalone View
contrib/buildbot/test/test_endpoint_buildDiff.py
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | def test_buildDiff(self): | ||||
def call_buildDiff(builds): | def call_buildDiff(builds): | ||||
self.teamcity.session.send.side_effect = [ | self.teamcity.session.send.side_effect = [ | ||||
test.mocks.teamcity.buildInfo(build_id=build.build_id, buildqueue=True) for build in builds | test.mocks.teamcity.buildInfo(build_id=build.build_id, buildqueue=True) for build in builds | ||||
] | ] | ||||
response = self.app.post( | response = self.app.post( | ||||
'/buildDiff{}'.format(data), | '/buildDiff{}'.format(data), | ||||
headers=self.headers) | headers=self.headers) | ||||
assert response.status_code == 200 | self.assertEqual(response.status_code, 200) | ||||
self.phab.get_file_content_from_master.assert_called() | self.phab.get_file_content_from_master.assert_called() | ||||
expected_calls = [ | expected_calls = [ | ||||
call(AnyWith(requests.PreparedRequest, { | call(AnyWith(requests.PreparedRequest, { | ||||
"url": "https://teamcity.test/app/rest/buildQueue", | "url": "https://teamcity.test/app/rest/buildQueue", | ||||
"body": json.dumps({ | "body": json.dumps({ | ||||
"branchName": data.stagingRef, | "branchName": data.stagingRef, | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |