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 the render_pictures binary. | 9 Test the render_pictures binary. |
10 """ | 10 """ |
(...skipping 22 matching lines...) Expand all Loading... |
33 output_json_path = os.path.join(self._temp_dir, 'output.json') | 33 output_json_path = os.path.join(self._temp_dir, 'output.json') |
34 self._run_skpmaker(['--writePath', input_skp_path]) | 34 self._run_skpmaker(['--writePath', input_skp_path]) |
35 self._run_render_pictures(['-r', input_skp_path, | 35 self._run_render_pictures(['-r', input_skp_path, |
36 '--bbh', 'grid', '256', '256', | 36 '--bbh', 'grid', '256', '256', |
37 '--mode', 'tile', '256', '256', | 37 '--mode', 'tile', '256', '256', |
38 '--writeJsonSummaryPath', output_json_path, | 38 '--writeJsonSummaryPath', output_json_path, |
39 '--writeWholeImage']) | 39 '--writeWholeImage']) |
40 expected_summary_dict = { | 40 expected_summary_dict = { |
41 "actual-results" : { | 41 "actual-results" : { |
42 "no-comparison" : { | 42 "no-comparison" : { |
43 "input.png" : [ "bitmap-64bitMD5", 12793741875005523433 ] | 43 # Manually verified: 640x400 red image with black border |
44 } | 44 "input.png" : [ "bitmap-64bitMD5", 11092453015575919668 ] |
45 } | 45 } |
46 } | 46 } |
| 47 } |
47 self._assert_json_contents(output_json_path, expected_summary_dict) | 48 self._assert_json_contents(output_json_path, expected_summary_dict) |
48 | 49 |
49 def test_tiled_no_comparison(self): | 50 def test_tiled_no_comparison(self): |
50 """Generate individual tiles. | 51 """Generate individual tiles. |
51 | 52 |
52 TODO(epoger): The results of this test are currently broken! | 53 TODO(epoger): The results of this test are currently broken! |
53 The summary should contain a list of tiles, but for some reason, it is | 54 The summary should contain a list of tiles, but for some reason, it is |
54 empty.""" | 55 empty.""" |
55 input_skp_path = os.path.join(self._temp_dir, 'input.skp') | 56 input_skp_path = os.path.join(self._temp_dir, 'input.skp') |
56 output_json_path = os.path.join(self._temp_dir, 'output.json') | 57 output_json_path = os.path.join(self._temp_dir, 'output.json') |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 actual_dict = json.loads(file_contents) | 119 actual_dict = json.loads(file_contents) |
119 self.assertEqual(actual_dict, expected_dict) | 120 self.assertEqual(actual_dict, expected_dict) |
120 | 121 |
121 | 122 |
122 def main(): | 123 def main(): |
123 base_unittest.main(RenderPicturesTest) | 124 base_unittest.main(RenderPicturesTest) |
124 | 125 |
125 | 126 |
126 if __name__ == '__main__': | 127 if __name__ == '__main__': |
127 main() | 128 main() |
OLD | NEW |