OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Tests for module json_summary_combiner.py""" | 6 """Tests for module json_summary_combiner.py""" |
7 | 7 |
8 import filecmp | 8 import filecmp |
9 import os | 9 import os |
10 import shutil | 10 import shutil |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 def _get_test_slave_name_to_info(self): | 71 def _get_test_slave_name_to_info(self): |
72 slave_name_to_info = { | 72 slave_name_to_info = { |
73 'slave1': json_summary_combiner.SlaveInfo( | 73 'slave1': json_summary_combiner.SlaveInfo( |
74 slave_name='slave1', | 74 slave_name='slave1', |
75 failed_files=[ | 75 failed_files=[ |
76 json_summary_combiner.FileInfo( | 76 json_summary_combiner.FileInfo( |
77 'fileslave1_1.png', | 77 'fileslave1_1.png', |
78 'http://storage.cloud.google.com/dummy-bucket/skps/slave1/' | 78 'http://storage.cloud.google.com/dummy-bucket/skps/slave1/' |
79 'fileslave1_.skp', | 79 'fileslave1_.skp', |
80 111, 112, 113, 114), | 80 111, 112, 113, 114, 115), |
81 json_summary_combiner.FileInfo( | 81 json_summary_combiner.FileInfo( |
82 'fileslave1_2.png', | 82 'fileslave1_2.png', |
83 'http://storage.cloud.google.com/dummy-bucket/skps/slave1/' | 83 'http://storage.cloud.google.com/dummy-bucket/skps/slave1/' |
84 'fileslave1_.skp', | 84 'fileslave1_.skp', |
85 121, 122, 123, 124)], | 85 121, 122, 123, 124, 125)], |
86 skps_location='gs://dummy-bucket/skps/slave1', | 86 skps_location='gs://dummy-bucket/skps/slave1', |
87 files_location_diffs='gs://dummy-bucket/slave1/diffs', | 87 files_location_diffs='gs://dummy-bucket/slave1/diffs', |
88 files_location_whitediffs='gs://dummy-bucket/slave1/whitediffs', | 88 files_location_whitediffs='gs://dummy-bucket/slave1/whitediffs', |
89 files_location_nopatch='gs://dummy-bucket/slave1/nopatch', | 89 files_location_nopatch='gs://dummy-bucket/slave1/nopatch', |
90 files_location_withpatch='gs://dummy-bucket/slave1/withpatch'), | 90 files_location_withpatch='gs://dummy-bucket/slave1/withpatch'), |
91 'slave2': json_summary_combiner.SlaveInfo( | 91 'slave2': json_summary_combiner.SlaveInfo( |
92 slave_name='slave2', | 92 slave_name='slave2', |
93 failed_files=[ | 93 failed_files=[ |
94 json_summary_combiner.FileInfo( | 94 json_summary_combiner.FileInfo( |
95 'fileslave2_1.png', | 95 'fileslave2_1.png', |
96 'http://storage.cloud.google.com/dummy-bucket/skps/slave2/' | 96 'http://storage.cloud.google.com/dummy-bucket/skps/slave2/' |
97 'fileslave2_.skp', | 97 'fileslave2_.skp', |
98 211, 212, 213, 214)], | 98 211, 212, 213, 214, 215)], |
99 skps_location='gs://dummy-bucket/skps/slave2', | 99 skps_location='gs://dummy-bucket/skps/slave2', |
100 files_location_diffs='gs://dummy-bucket/slave2/diffs', | 100 files_location_diffs='gs://dummy-bucket/slave2/diffs', |
101 files_location_whitediffs='gs://dummy-bucket/slave2/whitediffs', | 101 files_location_whitediffs='gs://dummy-bucket/slave2/whitediffs', |
102 files_location_nopatch='gs://dummy-bucket/slave2/nopatch', | 102 files_location_nopatch='gs://dummy-bucket/slave2/nopatch', |
103 files_location_withpatch='gs://dummy-bucket/slave2/withpatch'), | 103 files_location_withpatch='gs://dummy-bucket/slave2/withpatch'), |
104 'slave3': json_summary_combiner.SlaveInfo( | 104 'slave3': json_summary_combiner.SlaveInfo( |
105 slave_name='slave3', | 105 slave_name='slave3', |
106 failed_files=[ | 106 failed_files=[ |
107 json_summary_combiner.FileInfo( | 107 json_summary_combiner.FileInfo( |
108 'fileslave3_1.png', | 108 'fileslave3_1.png', |
109 'http://storage.cloud.google.com/dummy-bucket/skps/slave3/' | 109 'http://storage.cloud.google.com/dummy-bucket/skps/slave3/' |
110 'fileslave3_.skp', | 110 'fileslave3_.skp', |
111 311, 312, 313, 314), | 111 311, 312, 313, 314, 315), |
112 json_summary_combiner.FileInfo( | 112 json_summary_combiner.FileInfo( |
113 'fileslave3_2.png', | 113 'fileslave3_2.png', |
114 'http://storage.cloud.google.com/dummy-bucket/skps/slave3/' | 114 'http://storage.cloud.google.com/dummy-bucket/skps/slave3/' |
115 'fileslave3_.skp', | 115 'fileslave3_.skp', |
116 321, 322, 323, 324), | 116 321, 322, 323, 324, 325), |
117 json_summary_combiner.FileInfo( | 117 json_summary_combiner.FileInfo( |
118 'fileslave3_3.png', | 118 'fileslave3_3.png', |
119 'http://storage.cloud.google.com/dummy-bucket/skps/slave3/' | 119 'http://storage.cloud.google.com/dummy-bucket/skps/slave3/' |
120 'fileslave3_.skp', | 120 'fileslave3_.skp', |
121 331, 332, 333, 334), | 121 331, 332, 333, 334, 335), |
122 json_summary_combiner.FileInfo( | 122 json_summary_combiner.FileInfo( |
123 'fileslave3_4.png', | 123 'fileslave3_4.png', |
124 'http://storage.cloud.google.com/dummy-bucket/skps/slave3/' | 124 'http://storage.cloud.google.com/dummy-bucket/skps/slave3/' |
125 'fileslave3_.skp', | 125 'fileslave3_.skp', |
126 341, 342, 343, 344)], | 126 341, 342, 343, 344, 345)], |
127 skps_location='gs://dummy-bucket/skps/slave3', | 127 skps_location='gs://dummy-bucket/skps/slave3', |
128 files_location_diffs='gs://dummy-bucket/slave3/diffs', | 128 files_location_diffs='gs://dummy-bucket/slave3/diffs', |
129 files_location_whitediffs='gs://dummy-bucket/slave3/whitediffs', | 129 files_location_whitediffs='gs://dummy-bucket/slave3/whitediffs', |
130 files_location_nopatch='gs://dummy-bucket/slave3/nopatch', | 130 files_location_nopatch='gs://dummy-bucket/slave3/nopatch', |
131 files_location_withpatch='gs://dummy-bucket/slave3/withpatch') | 131 files_location_withpatch='gs://dummy-bucket/slave3/withpatch') |
132 } | 132 } |
133 return slave_name_to_info | 133 return slave_name_to_info |
134 | 134 |
135 def test_OutputToHTML_WithDifferences_WithAbsoluteUrl(self): | 135 def test_OutputToHTML_WithDifferences_WithAbsoluteUrl(self): |
136 slave_name_to_info = self._get_test_slave_name_to_info() | 136 slave_name_to_info = self._get_test_slave_name_to_info() |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 html_expected_dir = os.path.join(self._test_data_dir, 'html_outputs', | 180 html_expected_dir = os.path.join(self._test_data_dir, 'html_outputs', |
181 'nodifferences') | 181 'nodifferences') |
182 self.assertTrue( | 182 self.assertTrue( |
183 filecmp.cmp(os.path.join(html_expected_dir, 'index.html'), | 183 filecmp.cmp(os.path.join(html_expected_dir, 'index.html'), |
184 os.path.join(self._actual_html_dir, 'index.html'))) | 184 os.path.join(self._actual_html_dir, 'index.html'))) |
185 | 185 |
186 | 186 |
187 if __name__ == '__main__': | 187 if __name__ == '__main__': |
188 unittest.main() | 188 unittest.main() |
189 | 189 |
OLD | NEW |