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

Unified Diff: dashboard/dashboard/graph_csv_test.py

Issue 1549583002: In /graph_json, check internal_only on Test entity and skip test for all Row entities. (Closed) Base URL: https://github.com/catapult-project/catapult@master
Patch Set: Fixed assertions Created 5 years 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 | « dashboard/dashboard/graph_csv.py ('k') | dashboard/dashboard/graph_json.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/graph_csv_test.py
diff --git a/dashboard/dashboard/graph_csv_test.py b/dashboard/dashboard/graph_csv_test.py
index e323695315f3ac42423f7c8c688d537ef50499b1..9e6193dc1d586e47dc1691fd2e48ec64bd9814ca 100644
--- a/dashboard/dashboard/graph_csv_test.py
+++ b/dashboard/dashboard/graph_csv_test.py
@@ -44,14 +44,16 @@ class GraphCsvTest(testing_common.TestCase):
bot = graph_data.Bot(id=name, parent=master, internal_only=True).put()
bots.append(bot)
test = graph_data.Test(id='dromaeo', parent=bot, internal_only=True).put()
- dom_test = graph_data.Test(id='dom', parent=test, has_rows=True).put()
+ dom_test = graph_data.Test(
+ id='dom', parent=test, has_rows=True, internal_only=True).put()
test_container_key = utils.GetTestContainerKey(dom_test)
for i in range(1, 50):
graph_data.Row(
parent=test_container_key, id=i, value=float(i * 2), error=(i + 10),
internal_only=True).put()
- def _CheckGet(self, result_query, expected_result, whitelisted_ip=''):
+ def _CheckGet(
+ self, result_query, expected_result, whitelisted_ip='', status=200):
"""Asserts that the given query has the given CSV result.
Args:
@@ -61,7 +63,11 @@ class GraphCsvTest(testing_common.TestCase):
"""
response_rows = []
response = self.testapp.get(
- result_query, extra_environ={'REMOTE_ADDR': whitelisted_ip})
+ result_query,
+ extra_environ={'REMOTE_ADDR': whitelisted_ip},
+ status=status)
+ if status != 200:
+ return
for row in csv.reader(StringIO.StringIO(response.body)):
response_rows.append(row)
self.assertEqual(expected_result, response_rows)
@@ -145,9 +151,10 @@ class GraphCsvTest(testing_common.TestCase):
testing_common.SetIpWhitelist(['123.45.67.89'])
query = '/graph_csv?test_path=ChromiumPerf/win7/dromaeo/dom&num_points=3'
expected = [['revision', 'value']]
- self._CheckGet(query, expected)
+ self._CheckGet(query, expected, status=500)
def testGet_WhitelistedIPOnly(self):
+ self.PatchDatastoreHooksRequest('123.45.67.89')
self._AddMockInternalData()
self.UnsetCurrentUser()
datastore_hooks.InstallHooks()
« no previous file with comments | « dashboard/dashboard/graph_csv.py ('k') | dashboard/dashboard/graph_json.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698