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

Unified Diff: Tools/TestResultServer/handlers/testfilehandler_test.py

Issue 459243004: Fix 500 in test results server when querying testlistjson (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Tools/TestResultServer/handlers/testfilehandler.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/TestResultServer/handlers/testfilehandler_test.py
diff --git a/Tools/TestResultServer/handlers/testfilehandler_test.py b/Tools/TestResultServer/handlers/testfilehandler_test.py
index 29b3c03272c673da7efbc6d360ed9dde45f1308d..8b108c4bd16cbd51ebf21da88a1aba72cb1cbe2a 100755
--- a/Tools/TestResultServer/handlers/testfilehandler_test.py
+++ b/Tools/TestResultServer/handlers/testfilehandler_test.py
@@ -117,6 +117,32 @@ class TestFileHandlerTest(unittest.TestCase):
response_json = json.loads(response.normal_body)
self.assertEqual(response_json[builder]['tests']['Test1.testproc1'], {})
+ def test_get_nonexistant_results(self):
+ master = master_config.getMaster('chromium.chromiumos')
+ builder = 'test-builder'
+ test_type = 'test-type'
+
+ params = collections.OrderedDict([
+ (testfilehandler.PARAM_BUILDER, builder),
+ (testfilehandler.PARAM_MASTER, master['url_name']),
+ (testfilehandler.PARAM_TEST_TYPE, test_type),
+ (testfilehandler.PARAM_NAME, 'results.json')
+ ])
+
+ try:
+ response = self.testapp.get('/testfile', params=params)
+ except webtest.app.AppError as e:
+ # FIXME: Is there a better way to check for a 404?
+ self.assertIn('404', e.message)
+
+ params[testfilehandler.PARAM_TEST_LIST_JSON] = '1'
+
+ try:
+ response = self.testapp.get('/testfile', params=params)
+ except webtest.app.AppError as e:
+ # FIXME: Is there a better way to check for a 404?
+ self.assertIn('404', e.message)
+
def test_deprecated_master_name(self):
"""Verify that a file uploaded with a deprecated master name
can be downloaded by the corresponding new-style master name.
« no previous file with comments | « Tools/TestResultServer/handlers/testfilehandler.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698