| 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 imagepair.py | 9 Test imagepair.py |
| 10 """ | 10 """ |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 'arcofzorro/13786535001616823825.png', | 82 'arcofzorro/13786535001616823825.png', |
| 83 None, | 83 None, |
| 84 None, | 84 None, |
| 85 # expected output: | 85 # expected output: |
| 86 { | 86 { |
| 87 'differenceData': { | 87 'differenceData': { |
| 88 'maxDiffPerChannel': [255, 255, 247], | 88 'maxDiffPerChannel': [255, 255, 247], |
| 89 'numDifferingPixels': 662, | 89 'numDifferingPixels': 662, |
| 90 'percentDifferingPixels': 0.0662, | 90 'percentDifferingPixels': 0.0662, |
| 91 'perceptualDifference': 0.06620300000000157, | 91 'perceptualDifference': 0.06620300000000157, |
| 92 'diffUrl': 'arcofzorro_16206093933823793653_png_png-vs-' + |
| 93 'arcofzorro_13786535001616823825_png_png.png', |
| 94 'whiteDiffUrl': 'arcofzorro_16206093933823793653_png_png' + |
| 95 '-vs-arcofzorro_13786535001616823825_png_png.png', |
| 92 }, | 96 }, |
| 93 'imageAUrl': 'arcofzorro/16206093933823793653.png', | 97 'imageAUrl': 'arcofzorro/16206093933823793653.png', |
| 94 'imageBUrl': 'arcofzorro/13786535001616823825.png', | 98 'imageBUrl': 'arcofzorro/13786535001616823825.png', |
| 95 'isDifferent': True, | 99 'isDifferent': True, |
| 96 }, | 100 }, |
| 97 ], | 101 ], |
| 98 | 102 |
| 99 [ | 103 [ |
| 100 # inputs: | 104 # inputs: |
| 101 'gradients_degenerate_2pt/10552995703607727960.png', | 105 'gradients_degenerate_2pt/10552995703607727960.png', |
| 102 'gradients_degenerate_2pt/11198253335583713230.png', | 106 'gradients_degenerate_2pt/11198253335583713230.png', |
| 103 { | 107 { |
| 104 'ignoreFailure': True, | 108 'ignoreFailure': True, |
| 105 'bugs': [1001, 1002], | 109 'bugs': [1001, 1002], |
| 106 }, | 110 }, |
| 107 { | 111 { |
| 108 'builder': 'MyBuilder', | 112 'builder': 'MyBuilder', |
| 109 'test': 'MyTest', | 113 'test': 'MyTest', |
| 110 }, | 114 }, |
| 111 # expected output: | 115 # expected output: |
| 112 { | 116 { |
| 113 'differenceData': { | 117 'differenceData': { |
| 114 'maxDiffPerChannel': [255, 0, 255], | 118 'maxDiffPerChannel': [255, 0, 255], |
| 115 'numDifferingPixels': 102400, | 119 'numDifferingPixels': 102400, |
| 116 'percentDifferingPixels': 100.00, | 120 'percentDifferingPixels': 100.00, |
| 117 'perceptualDifference': 100.00, | 121 'perceptualDifference': 100.00, |
| 122 'diffUrl': 'gradients_degenerate_2pt_10552995703607727960' + |
| 123 '_png_png-vs-gradients_degenerate_2pt_' + |
| 124 '11198253335583713230_png_png.png', |
| 125 'whiteDiffUrl': 'gradients_degenerate_2pt_' + |
| 126 '10552995703607727960_png_png-vs-' + |
| 127 'gradients_degenerate_2pt_11198253335583713230' + |
| 128 '_png_png.png' |
| 118 }, | 129 }, |
| 119 'expectations': { | 130 'expectations': { |
| 120 'bugs': [1001, 1002], | 131 'bugs': [1001, 1002], |
| 121 'ignoreFailure': True, | 132 'ignoreFailure': True, |
| 122 }, | 133 }, |
| 123 'extraColumns': { | 134 'extraColumns': { |
| 124 'builder': 'MyBuilder', | 135 'builder': 'MyBuilder', |
| 125 'test': 'MyTest', | 136 'test': 'MyTest', |
| 126 }, | 137 }, |
| 127 'imageAUrl': | 138 'imageAUrl': |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 self.assertEqual(image_pair.as_dict(), selftest[4]) | 204 self.assertEqual(image_pair.as_dict(), selftest[4]) |
| 194 | 205 |
| 195 | 206 |
| 196 def main(): | 207 def main(): |
| 197 suite = unittest.TestLoader().loadTestsFromTestCase(ImagePairTest) | 208 suite = unittest.TestLoader().loadTestsFromTestCase(ImagePairTest) |
| 198 unittest.TextTestRunner(verbosity=2).run(suite) | 209 unittest.TextTestRunner(verbosity=2).run(suite) |
| 199 | 210 |
| 200 | 211 |
| 201 if __name__ == '__main__': | 212 if __name__ == '__main__': |
| 202 main() | 213 main() |
| OLD | NEW |