OLD | NEW |
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 JsonResults.update(master['url_name'], builder, test_type, test_data[1],
master['name'], True) | 1155 JsonResults.update(master['url_name'], builder, test_type, test_data[1],
master['name'], True) |
1156 # Verify that the file keyed by url_name contains both sets of results. | 1156 # Verify that the file keyed by url_name contains both sets of results. |
1157 files = TestFile.get_files(master['url_name'], builder, test_type, None,
None, limit=3) | 1157 files = TestFile.get_files(master['url_name'], builder, test_type, None,
None, limit=3) |
1158 self.assertEqual(len(files), 2) | 1158 self.assertEqual(len(files), 2) |
1159 for f in files: | 1159 for f in files: |
1160 j = json.loads(f.data) | 1160 j = json.loads(f.data) |
1161 self.assertItemsEqual(j[builder]['blinkRevision'], ['12345', '54321'
]) | 1161 self.assertItemsEqual(j[builder]['blinkRevision'], ['12345', '54321'
]) |
1162 | 1162 |
1163 tb.deactivate() | 1163 tb.deactivate() |
1164 | 1164 |
| 1165 def test_normalize_results_with_top_level_results_key_does_not_crash(self): |
| 1166 aggregated_json = { |
| 1167 'Linux Tests': { |
| 1168 'results': {'foo': {'results': [(1, 'P')], |
| 1169 'times': [(1, 1)]}}, |
| 1170 } |
| 1171 } |
| 1172 JsonResults._normalize_results(aggregated_json, 1, 2) |
| 1173 |
1165 if __name__ == '__main__': | 1174 if __name__ == '__main__': |
1166 unittest.main() | 1175 unittest.main() |
OLD | NEW |