Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: gm/rebaseline_server/imagepairset_test.py

Issue 270413002: rebaseline_server JSON: pass category values as values, not keys (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698