def test_fetch_results_with_weird_step_name(self): buildbot = BuildBot() buildbot.web = MockWeb( urls={ 'https://test-results.appspot.com/testfile?buildnumber=123&' 'callback=ADD_RESULTS&builder=builder&name=full_results.json': 'ADD_RESULTS(%s);' % (json.dumps([{ "TestType": "webkit_layout_tests on Intel GPU (with patch)" }, { "TestType": "base_unittests (with patch)" }])), 'https://test-results.appspot.com/data/layout_results/builder/123/' 'webkit_layout_tests%20on%20Intel%20GPU%20%28with%20patch%29/' 'layout-test-results/failing_results.json': json.dumps({'passed': True}), }) results = buildbot.fetch_results(Build('builder', 123)) self.assertEqual( results._results, { # pylint: disable=protected-access 'passed': True }) self.assertLog([])
def test_fetch_layout_test_results_weird_step_name(self): buildbot = BuildBot() def fetch_file(url): if '/testfile' in url: return ('ADD_RESULTS(%s);' % (json.dumps( [{"TestType": "webkit_layout_tests on Intel GPU (with patch)"}, {"TestType": "base_unittests (with patch)"}]))) return json.dumps({'passed': True}) if url.endswith('failing_results.json') else 'deadbeef' buildbot.fetch_file = fetch_file results = buildbot.fetch_results(Build('builder', 123)) self.assertEqual(results._results, { # pylint: disable=protected-access 'passed': True }) self.assertLog([])
def test_fetch_results_without_build_number(self): buildbot = BuildBot() self.assertIsNone(buildbot.fetch_results(Build('builder', None)))