def test_get_failing_results_dict_some_failing_results(self): host = self.mock_host() host.buildbot.set_results( Build('MOCK Try Mac10.10', 123), LayoutTestResults({ 'tests': { 'external': { 'wpt': { 'x': { 'failing-test.html': { 'expected': 'PASS', 'actual': 'IMAGE', 'is_unexpected': True, }, }, }, }, }, })) updater = WPTExpectationsUpdater(host) results_dict = updater.get_failing_results_dict( Build('MOCK Try Mac10.10', 123)) self.assertEqual( results_dict, { 'external/wpt/x/failing-test.html': { 'test-mac-mac10.10': SimpleTestResult( actual='IMAGE', expected='PASS', bug='crbug.com/626703', ), }, })
def test_get_failing_results_dict_no_results(self): host = self.mock_host() host.buildbot = MockBuildBot() host.buildbot.set_results(Build('MOCK Try Mac10.10', 123), None) updater = WPTExpectationsUpdater(host) self.assertEqual( updater.get_failing_results_dict(Build('MOCK Try Mac10.10', 123)), {})
def test_get_failing_results_dict_non_wpt_test(self): host = self.mock_host() host.buildbot.set_results(Build('MOCK Try Mac10.10', 123), LayoutTestResults({ 'tests': { 'x': { 'failing-test.html': { 'expected': 'PASS', 'actual': 'IMAGE', 'is_unexpected': True, }, }, }, })) updater = WPTExpectationsUpdater(host) results_dict = updater.get_failing_results_dict(Build('MOCK Try Mac10.10', 123)) self.assertEqual(results_dict, {})
def test_get_failing_results_dict_only_passing_results(self): host = self.mock_host() host.buildbot.set_results( Build('MOCK Try Mac10.10', 123), LayoutTestResults({ 'tests': { 'x': { 'passing-test.html': { 'expected': 'PASS', 'actual': 'PASS', }, }, }, })) updater = WPTExpectationsUpdater(host) self.assertEqual( updater.get_failing_results_dict(Build('MOCK Try Mac10.10', 123)), {})