Chromium Code Reviews| Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations_unittest.py |
| diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations_unittest.py |
| index 7ae39f438a82f235468c05db16f988b67c46de45..71c755bd1325a748dc350516b68464dbb1a17b7a 100644 |
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations_unittest.py |
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations_unittest.py |
| @@ -22,42 +22,49 @@ class UpdateW3CTestExpectationsTest(unittest.TestCase, W3CExpectationsLineAdder) |
| } |
| } |
| self.mock_dict_two = { |
| - 'fake/test/path.html': { |
| + 'imported/fake/test/path.html': { |
| 'one': {'expected': 'FAIL', 'actual': 'PASS', 'bug': 'crbug.com/626703'}, |
| 'two': {'expected': 'FAIL', 'actual': 'TIMEOUT', 'bug': 'crbug.com/626703'}, |
| 'three': {'expected': 'FAIL', 'actual': 'PASS', 'bug': 'crbug.com/626703'} |
| } |
| } |
| self.mock_dict_three = { |
| - 'fake/test/path.html': { |
| + 'imported/fake/test/path.html': { |
| 'four': {'expected': 'FAIL', 'actual': 'PASS', 'bug': 'crbug.com/626703'}} |
| } |
| + self.mock_dict_four = { |
| + 'imported/fake/test/path.html': { |
| + 'one': {'expected': 'FAIL', 'actual': 'TIMEOUT', 'bug': 'crbug.com/626703'} |
| + } |
| + } |
| def test_merge_same_valued_keys(self): |
| self.assertEqual(self.merge_same_valued_keys(self.mock_dict_one['fake/test/path.html']), { |
| ('two', 'one'): {'expected': 'FAIL', 'actual': 'PASS', 'bug': 'crbug.com/626703'} |
| }) |
| - self.assertEqual(self.merge_same_valued_keys(self.mock_dict_two['fake/test/path.html']), { |
| + self.assertEqual(self.merge_same_valued_keys(self.mock_dict_two['imported/fake/test/path.html']), { |
| ('three', 'one'): {'expected': 'FAIL', 'actual': 'PASS', 'bug': 'crbug.com/626703'}, |
| 'two': {'expected': 'FAIL', 'actual': 'TIMEOUT', 'bug': 'crbug.com/626703'} |
| }) |
| def test_get_expectations(self): |
| - self.assertEqual(self.get_expectations({'expected': 'FAIL', 'actual': 'PASS'}), ['Pass']) |
| - self.assertEqual(self.get_expectations({'expected': 'FAIL', 'actual': 'TIMEOUT'}), ['Timeout']) |
| - self.assertEqual(self.get_expectations({'expected': 'TIMEOUT', 'actual': 'PASS'}), ['Pass', 'Timeout']) |
| - |
| - def test_create_line_list(self): |
| - self.assertEqual(self.create_line_list(self.mock_dict_one), |
| - ['crbug.com/626703 [ two ] fake/test/path.html [ Pass ]', |
| - 'crbug.com/626703 [ one ] fake/test/path.html [ Pass ]']) |
| + self.assertEqual(self.get_expectations({'expected': 'FAIL', 'actual': 'PASS'}), set(['Pass'])) |
| + self.assertEqual(self.get_expectations({'expected': 'FAIL', 'actual': 'TIMEOUT'}), set(['Timeout'])) |
| + self.assertEqual(self.get_expectations({'expected': 'TIMEOUT', 'actual': 'PASS'}), set(['Pass'])) |
| + self.assertEqual(self.get_expectations({'expected': 'PASS', 'actual': 'TIMEOUT CRASH FAIL'}), set(['Crash', 'Failure', 'Timeout'])) |
|
qyearsley
2016/07/26 23:59:43
Note: I'm not entirely sure if actual can ever con
|
| + self.assertEqual(self.get_expectations({'expected': 'SLOW CRASH FAIL TIMEOUT', 'actual': 'PASS'}), set(['Pass'])) |
| + |
|
qyearsley
2016/07/26 23:59:43
What about cases where the results are "as expecte
qyearsley
2016/07/27 17:25:39
Based on your answer above, I think that it's assu
|
| + def test_create_line_list_with_non_new_test(self): |
|
qyearsley
2016/07/26 23:59:43
non_new_test -> no_new_tests
|
| + self.assertEqual(self.create_line_list(self.mock_dict_one), []) |
| + |
| + def test_create_line_list_with_new_test(self): |
| self.assertEqual(self.create_line_list(self.mock_dict_two), |
| - ['crbug.com/626703 [ three ] fake/test/path.html [ Pass ]', |
| - 'crbug.com/626703 [ two ] fake/test/path.html [ Timeout ]', |
| - 'crbug.com/626703 [ one ] fake/test/path.html [ Pass ]']) |
| + ['crbug.com/626703 [ three ] imported/fake/test/path.html [ Pass ]', |
| + 'crbug.com/626703 [ two ] imported/fake/test/path.html [ Timeout ]', |
| + 'crbug.com/626703 [ one ] imported/fake/test/path.html [ Pass ]']) |
| def test_merge_dicts_with_conflict_raise_exception(self): |
| - self.assertRaises(ValueError, self.merge_dicts, self.mock_dict_one, self.mock_dict_two) |
| + self.assertRaises(ValueError, self.merge_dicts, self.mock_dict_two, self.mock_dict_four) |
| def test_merge_dicts_merges_second_dict_into_first(self): |
| output = self.merge_dicts(self.mock_dict_one, self.mock_dict_three) |