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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 """Assembles some ImagePairs into an ImagePairSet, and validates results. | 81 """Assembles some ImagePairs into an ImagePairSet, and validates results. |
82 """ | 82 """ |
83 image_pairs = [ | 83 image_pairs = [ |
84 MockImagePair(base_url=BASE_URL_1, dict_to_return=IMAGEPAIR_1_AS_DICT), | 84 MockImagePair(base_url=BASE_URL_1, dict_to_return=IMAGEPAIR_1_AS_DICT), |
85 MockImagePair(base_url=BASE_URL_1, dict_to_return=IMAGEPAIR_2_AS_DICT), | 85 MockImagePair(base_url=BASE_URL_1, dict_to_return=IMAGEPAIR_2_AS_DICT), |
86 MockImagePair(base_url=BASE_URL_1, dict_to_return=IMAGEPAIR_3_AS_DICT), | 86 MockImagePair(base_url=BASE_URL_1, dict_to_return=IMAGEPAIR_3_AS_DICT), |
87 ] | 87 ] |
88 expected_imageset_dict = { | 88 expected_imageset_dict = { |
89 'extraColumnHeaders': { | 89 'extraColumnHeaders': { |
90 'builder': { | 90 'builder': { |
91 'counts': [3], | |
91 'headerText': 'builder', | 92 'headerText': 'builder', |
92 'isFilterable': True, | 93 'isFilterable': True, |
93 'isSortable': True, | 94 'isSortable': True, |
94 'valuesAndCounts': { | 95 'values': ['MyBuilder'], |
borenet
2014/05/08 12:40:18
My concern with this format is that it's possible
epoger
2014/05/08 15:04:35
JSON doesn't have a concept of tuples, but I could
| |
95 'MyBuilder': 3 | |
96 }, | |
97 }, | 96 }, |
98 'test': { | 97 'test': { |
99 'headerText': 'which GM test', | 98 'headerText': 'which GM test', |
100 'headerUrl': 'http://learn/about/gm/tests', | 99 'headerUrl': 'http://learn/about/gm/tests', |
101 'isFilterable': True, | 100 'isFilterable': True, |
102 'isSortable': False, | 101 'isSortable': False, |
103 }, | 102 }, |
104 }, | 103 }, |
105 'imagePairs': [ | 104 'imagePairs': [ |
106 IMAGEPAIR_1_AS_DICT, | 105 IMAGEPAIR_1_AS_DICT, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 return self._dict_to_return | 174 return self._dict_to_return |
176 | 175 |
177 | 176 |
178 def main(): | 177 def main(): |
179 suite = unittest.TestLoader().loadTestsFromTestCase(ImagePairSetTest) | 178 suite = unittest.TestLoader().loadTestsFromTestCase(ImagePairSetTest) |
180 unittest.TextTestRunner(verbosity=2).run(suite) | 179 unittest.TextTestRunner(verbosity=2).run(suite) |
181 | 180 |
182 | 181 |
183 if __name__ == '__main__': | 182 if __name__ == '__main__': |
184 main() | 183 main() |
OLD | NEW |