Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: gm/rebaseline_server/results_test.py

Issue 848073005: Revert "delete old things!" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/rebaseline_server/results.py ('k') | gm/rebaseline_server/rs_fixpypath.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/python
2
3 """
4 Copyright 2014 Google Inc.
5
6 Use of this source code is governed by a BSD-style license that can be
7 found in the LICENSE file.
8
9 Test results.py
10
11 """
12
13 # Imports from within Skia
14 import base_unittest
15 import results
16
17
18 class ResultsTest(base_unittest.TestCase):
19
20 def test_ignore_builder(self):
21 """Test _ignore_builder()."""
22 results_obj = results.BaseComparisons()
23 self.assertEqual(results_obj._ignore_builder('SomethingTSAN'), True)
24 self.assertEqual(results_obj._ignore_builder('Something-Trybot'), True)
25 self.assertEqual(results_obj._ignore_builder(
26 'Test-Ubuntu12-ShuttleA-GTX660-x86-Release'), False)
27 results_obj.set_skip_builders_pattern_list(['.*TSAN.*', '.*GTX660.*'])
28 self.assertEqual(results_obj._ignore_builder('SomethingTSAN'), True)
29 self.assertEqual(results_obj._ignore_builder('Something-Trybot'), False)
30 self.assertEqual(results_obj._ignore_builder(
31 'Test-Ubuntu12-ShuttleA-GTX660-x86-Release'), True)
32 results_obj.set_skip_builders_pattern_list(None)
33 self.assertEqual(results_obj._ignore_builder('SomethingTSAN'), False)
34 self.assertEqual(results_obj._ignore_builder('Something-Trybot'), False)
35 self.assertEqual(results_obj._ignore_builder(
36 'Test-Ubuntu12-ShuttleA-GTX660-x86-Release'), False)
37 results_obj.set_match_builders_pattern_list(['.*TSAN'])
38 self.assertEqual(results_obj._ignore_builder('SomethingTSAN'), False)
39 self.assertEqual(results_obj._ignore_builder('Something-Trybot'), True)
40 self.assertEqual(results_obj._ignore_builder(
41 'Test-Ubuntu12-ShuttleA-GTX660-x86-Release'), True)
42
43 def test_combine_subdicts_typical(self):
44 """Test combine_subdicts() with no merge conflicts. """
45 input_dict = {
46 "failed" : {
47 "changed.png" : [ "bitmap-64bitMD5", 8891695120562235492 ],
48 },
49 "no-comparison" : {
50 "unchanged.png" : [ "bitmap-64bitMD5", 11092453015575919668 ],
51 }
52 }
53 expected_output_dict = {
54 "changed.png" : [ "bitmap-64bitMD5", 8891695120562235492 ],
55 "unchanged.png" : [ "bitmap-64bitMD5", 11092453015575919668 ],
56 }
57 actual_output_dict = results.BaseComparisons.combine_subdicts(
58 input_dict=input_dict)
59 self.assertEqual(actual_output_dict, expected_output_dict)
60
61 def test_combine_subdicts_with_merge_conflict(self):
62 """Test combine_subdicts() with a merge conflict. """
63 input_dict = {
64 "failed" : {
65 "changed.png" : [ "bitmap-64bitMD5", 8891695120562235492 ],
66 },
67 "no-comparison" : {
68 "changed.png" : [ "bitmap-64bitMD5", 11092453015575919668 ],
69 }
70 }
71 with self.assertRaises(Exception):
72 actual_output_dict = results.BaseComparisons.combine_subdicts(
73 input_dict=input_dict)
74
75
76 def main():
77 base_unittest.main(ResultsTest)
78
79
80 if __name__ == '__main__':
81 main()
OLDNEW
« no previous file with comments | « gm/rebaseline_server/results.py ('k') | gm/rebaseline_server/rs_fixpypath.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698