| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 'arcofzorro/16206093933823793653.png', | 80 'arcofzorro/16206093933823793653.png', |
| 81 'arcofzorro/13786535001616823825.png', | 81 'arcofzorro/13786535001616823825.png', |
| 82 None, | 82 None, |
| 83 None, | 83 None, |
| 84 # expected output: | 84 # expected output: |
| 85 { | 85 { |
| 86 'differenceData': { | 86 'differenceData': { |
| 87 'maxDiffPerChannel': [255, 255, 247], | 87 'maxDiffPerChannel': [255, 255, 247], |
| 88 'numDifferingPixels': 662, | 88 'numDifferingPixels': 662, |
| 89 'percentDifferingPixels': 0.0662, | 89 'percentDifferingPixels': 0.0662, |
| 90 'perceptualDifference': 0.06620000000000914, |
| 90 'weightedDiffMeasure': 0.01127756555171088, | 91 'weightedDiffMeasure': 0.01127756555171088, |
| 91 }, | 92 }, |
| 92 'imageAUrl': 'arcofzorro/16206093933823793653.png', | 93 'imageAUrl': 'arcofzorro/16206093933823793653.png', |
| 93 'imageBUrl': 'arcofzorro/13786535001616823825.png', | 94 'imageBUrl': 'arcofzorro/13786535001616823825.png', |
| 94 'isDifferent': True, | 95 'isDifferent': True, |
| 95 }, | 96 }, |
| 96 ], | 97 ], |
| 97 | 98 |
| 98 [ | 99 [ |
| 99 # inputs: | 100 # inputs: |
| 100 'gradients_degenerate_2pt/10552995703607727960.png', | 101 'gradients_degenerate_2pt/10552995703607727960.png', |
| 101 'gradients_degenerate_2pt/11198253335583713230.png', | 102 'gradients_degenerate_2pt/11198253335583713230.png', |
| 102 { | 103 { |
| 103 'ignoreFailure': True, | 104 'ignoreFailure': True, |
| 104 'bugs': [1001, 1002], | 105 'bugs': [1001, 1002], |
| 105 }, | 106 }, |
| 106 { | 107 { |
| 107 'builder': 'MyBuilder', | 108 'builder': 'MyBuilder', |
| 108 'test': 'MyTest', | 109 'test': 'MyTest', |
| 109 }, | 110 }, |
| 110 # expected output: | 111 # expected output: |
| 111 { | 112 { |
| 112 'differenceData': { | 113 'differenceData': { |
| 113 'maxDiffPerChannel': [255, 0, 255], | 114 'maxDiffPerChannel': [255, 0, 255], |
| 114 'numDifferingPixels': 102400, | 115 'numDifferingPixels': 102400, |
| 115 'percentDifferingPixels': 100.00, | 116 'percentDifferingPixels': 100.00, |
| 117 'perceptualDifference': 100.00, |
| 116 'weightedDiffMeasure': 66.66666666666667, | 118 'weightedDiffMeasure': 66.66666666666667, |
| 117 }, | 119 }, |
| 118 'expectations': { | 120 'expectations': { |
| 119 'bugs': [1001, 1002], | 121 'bugs': [1001, 1002], |
| 120 'ignoreFailure': True, | 122 'ignoreFailure': True, |
| 121 }, | 123 }, |
| 122 'extraColumns': { | 124 'extraColumns': { |
| 123 'builder': 'MyBuilder', | 125 'builder': 'MyBuilder', |
| 124 'test': 'MyTest', | 126 'test': 'MyTest', |
| 125 }, | 127 }, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 144 self.assertEqual(image_pair.as_dict(), selftest[4]) | 146 self.assertEqual(image_pair.as_dict(), selftest[4]) |
| 145 | 147 |
| 146 | 148 |
| 147 def main(): | 149 def main(): |
| 148 suite = unittest.TestLoader().loadTestsFromTestCase(ImagePairTest) | 150 suite = unittest.TestLoader().loadTestsFromTestCase(ImagePairTest) |
| 149 unittest.TextTestRunner(verbosity=2).run(suite) | 151 unittest.TextTestRunner(verbosity=2).run(suite) |
| 150 | 152 |
| 151 | 153 |
| 152 if __name__ == '__main__': | 154 if __name__ == '__main__': |
| 153 main() | 155 main() |
| OLD | NEW |