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

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

Issue 216103004: teach rebaseline_server how to compare results of multiple render_pictures runs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ravi comments Created 6 years, 8 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
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_combine_subdicts_typical(self):
21 """Test combine_subdicts() with no merge conflicts. """
22 input_dict = {
23 "failed" : {
24 "changed.png" : [ "bitmap-64bitMD5", 8891695120562235492 ],
25 },
26 "no-comparison" : {
27 "unchanged.png" : [ "bitmap-64bitMD5", 11092453015575919668 ],
28 }
29 }
30 expected_output_dict = {
31 "changed.png" : [ "bitmap-64bitMD5", 8891695120562235492 ],
32 "unchanged.png" : [ "bitmap-64bitMD5", 11092453015575919668 ],
33 }
34 actual_output_dict = results.BaseComparisons.combine_subdicts(
35 input_dict=input_dict)
36 self.assertEqual(actual_output_dict, expected_output_dict)
37
38 def test_combine_subdicts_with_merge_conflict(self):
39 """Test combine_subdicts() with a merge conflict. """
40 input_dict = {
41 "failed" : {
42 "changed.png" : [ "bitmap-64bitMD5", 8891695120562235492 ],
43 },
44 "no-comparison" : {
45 "changed.png" : [ "bitmap-64bitMD5", 11092453015575919668 ],
46 }
47 }
48 with self.assertRaises(Exception):
49 actual_output_dict = results.BaseComparisons.combine_subdicts(
50 input_dict=input_dict)
51
52
53 def main():
54 base_unittest.main(ResultsTest)
55
56
57 if __name__ == '__main__':
58 main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698