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

Side by Side Diff: Tools/TestResultServer/model/jsonresults_unittest.py

Issue 475503005: Handle tries of results data in upload (fix _is_directory). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add a test, fix unrelated failing unittest Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
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
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()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698