Changeset View
Changeset View
Standalone View
Standalone View
contrib/buildbot/test/test_endpoint_buildDiff.py
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | def test_buildDiff(self): | ||||
config) | config) | ||||
def call_buildDiff(expectedBuilds): | def call_buildDiff(expectedBuilds): | ||||
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 expectedBuilds | test.mocks.teamcity.buildInfo(build_id=build.build_id, buildqueue=True) for build in expectedBuilds | ||||
] | ] | ||||
self.phab.differential.getcommitpaths = mock.Mock() | self.phab.differential.getcommitpaths = mock.Mock() | ||||
self.phab.differential.getcommitpaths.return_value = { | self.phab.differential.getcommitpaths.return_value = [ | ||||
"0": "dir/subdir/file.h", | "dir/subdir/file.h", | ||||
"1": "dir/subdir/file.cpp", | "dir/subdir/file.cpp", | ||||
"2": "someotherdir/file2.txt", | "someotherdir/file2.txt", | ||||
} | ] | ||||
response = self.app.post( | response = self.app.post( | ||||
'/buildDiff{}'.format(data), | '/buildDiff{}'.format(data), | ||||
headers=self.headers) | headers=self.headers) | ||||
self.assertEqual(response.status_code, 200) | self.assertEqual(response.status_code, 200) | ||||
self.phab.differential.getcommitpaths.assert_called() | self.phab.differential.getcommitpaths.assert_called() | ||||
self.phab.get_file_content_from_master.assert_called() | self.phab.get_file_content_from_master.assert_called() | ||||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |