OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 """ | 3 """ |
4 Copyright 2014 Google Inc. | 4 Copyright 2014 Google Inc. |
5 | 5 |
6 Use of this source code is governed by a BSD-style license that can be | 6 Use of this source code is governed by a BSD-style license that can be |
7 found in the LICENSE file. | 7 found in the LICENSE file. |
8 | 8 |
9 Test imagepairset.py | 9 Test imagepairset.py |
10 """ | 10 """ |
(...skipping 17 matching lines...) Expand all Loading... |
28 }, | 28 }, |
29 imagepair.KEY__IMAGEPAIRS__IMAGE_A_URL: 'test1/1111.png', | 29 imagepair.KEY__IMAGEPAIRS__IMAGE_A_URL: 'test1/1111.png', |
30 imagepair.KEY__IMAGEPAIRS__IMAGE_B_URL: 'test1/1111.png', | 30 imagepair.KEY__IMAGEPAIRS__IMAGE_B_URL: 'test1/1111.png', |
31 imagepair.KEY__IMAGEPAIRS__IS_DIFFERENT: False, | 31 imagepair.KEY__IMAGEPAIRS__IS_DIFFERENT: False, |
32 } | 32 } |
33 IMAGEPAIR_2_AS_DICT = { | 33 IMAGEPAIR_2_AS_DICT = { |
34 imagepair.KEY__IMAGEPAIRS__DIFFERENCES: { | 34 imagepair.KEY__IMAGEPAIRS__DIFFERENCES: { |
35 'maxDiffPerChannel': [1, 2, 3], | 35 'maxDiffPerChannel': [1, 2, 3], |
36 'numDifferingPixels': 111, | 36 'numDifferingPixels': 111, |
37 'percentDifferingPixels': 22.222, | 37 'percentDifferingPixels': 22.222, |
38 'weightedDiffMeasure': 33.333, | |
39 }, | 38 }, |
40 imagepair.KEY__IMAGEPAIRS__EXTRACOLUMNS: { | 39 imagepair.KEY__IMAGEPAIRS__EXTRACOLUMNS: { |
41 'builder': 'MyBuilder', | 40 'builder': 'MyBuilder', |
42 'test': 'test2', | 41 'test': 'test2', |
43 }, | 42 }, |
44 imagepair.KEY__IMAGEPAIRS__IMAGE_A_URL: 'test2/2222.png', | 43 imagepair.KEY__IMAGEPAIRS__IMAGE_A_URL: 'test2/2222.png', |
45 imagepair.KEY__IMAGEPAIRS__IMAGE_B_URL: 'test2/22223.png', | 44 imagepair.KEY__IMAGEPAIRS__IMAGE_B_URL: 'test2/22223.png', |
46 imagepair.KEY__IMAGEPAIRS__IS_DIFFERENT: True, | 45 imagepair.KEY__IMAGEPAIRS__IS_DIFFERENT: True, |
47 } | 46 } |
48 IMAGEPAIR_3_AS_DICT = { | 47 IMAGEPAIR_3_AS_DICT = { |
49 imagepair.KEY__IMAGEPAIRS__DIFFERENCES: { | 48 imagepair.KEY__IMAGEPAIRS__DIFFERENCES: { |
50 'maxDiffPerChannel': [4, 5, 6], | 49 'maxDiffPerChannel': [4, 5, 6], |
51 'numDifferingPixels': 111, | 50 'numDifferingPixels': 111, |
52 'percentDifferingPixels': 44.444, | 51 'percentDifferingPixels': 44.444, |
53 'weightedDiffMeasure': 33.333, | |
54 }, | 52 }, |
55 imagepair.KEY__IMAGEPAIRS__EXPECTATIONS: { | 53 imagepair.KEY__IMAGEPAIRS__EXPECTATIONS: { |
56 'bugs': [1001, 1002], | 54 'bugs': [1001, 1002], |
57 'ignoreFailure': True, | 55 'ignoreFailure': True, |
58 }, | 56 }, |
59 imagepair.KEY__IMAGEPAIRS__EXTRACOLUMNS: { | 57 imagepair.KEY__IMAGEPAIRS__EXTRACOLUMNS: { |
60 'builder': 'MyBuilder', | 58 'builder': 'MyBuilder', |
61 'test': 'test3', | 59 'test': 'test3', |
62 }, | 60 }, |
63 imagepair.KEY__IMAGEPAIRS__IMAGE_A_URL: 'test3/3333.png', | 61 imagepair.KEY__IMAGEPAIRS__IMAGE_A_URL: 'test3/3333.png', |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 return self._dict_to_return | 171 return self._dict_to_return |
174 | 172 |
175 | 173 |
176 def main(): | 174 def main(): |
177 suite = unittest.TestLoader().loadTestsFromTestCase(ImagePairSetTest) | 175 suite = unittest.TestLoader().loadTestsFromTestCase(ImagePairSetTest) |
178 unittest.TextTestRunner(verbosity=2).run(suite) | 176 unittest.TextTestRunner(verbosity=2).run(suite) |
179 | 177 |
180 | 178 |
181 if __name__ == '__main__': | 179 if __name__ == '__main__': |
182 main() | 180 main() |
OLD | NEW |