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

Side by Side Diff: appengine/chromium_cq_status/tests/post_test.py

Issue 499103002: Make test_results deployable again. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: merge to ToT Created 6 years, 3 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
« no previous file with comments | « no previous file | appengine/chromium_cq_status/tests/query_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 import json
6 import os 6 import os
7 import sys
8
9 # App Engine source file imports must be relative to their app's root.
10 sys.path.append(os.path.dirname(os.path.dirname(__file__)))
11 7
12 from appengine.utils import testing 8 from appengine.utils import testing
13 from appengine.chromium_cq_status import main 9
14 from appengine.chromium_cq_status.model.record import Record 10 from appengine.path_mangler_hack import PathMangler
11 with PathMangler(os.path.dirname(os.path.dirname(__file__))):
12 from appengine.chromium_cq_status import main
13 from appengine.chromium_cq_status.model.record import Record
14
15 from webtest.app import AppError 15 from webtest.app import AppError
16 16
17 class TestPost(testing.AppengineTestCase): 17 class TestPost(testing.AppengineTestCase):
18 app_module = main.app 18 app_module = main.app
19 19
20 def test_post_disallowed(self): 20 def test_post_disallowed(self):
21 self.mock_current_user(is_admin=False) 21 self.mock_current_user(is_admin=False)
22 22
23 # 403 status response crashes webtest. 23 # 403 status response crashes webtest.
24 self.assertRaises(AppError, lambda: self.test_app.post('/post')) 24 self.assertRaises(AppError, lambda: self.test_app.post('/post'))
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 self.assertEquals(set(['hello', 'world']), set(record.tags)) 127 self.assertEquals(set(['hello', 'world']), set(record.tags))
128 self.assertEquals({'hello': 'world'}, record.fields) 128 self.assertEquals({'hello': 'world'}, record.fields)
129 129
130 record = Record.get_by_id('multiple_1') 130 record = Record.get_by_id('multiple_1')
131 self.assertEquals(['issue=autotagged'], record.tags) 131 self.assertEquals(['issue=autotagged'], record.tags)
132 self.assertEquals({'issue': 'autotagged'}, record.fields) 132 self.assertEquals({'issue': 'autotagged'}, record.fields)
133 133
134 record = Record.get_by_id('multiple_2') 134 record = Record.get_by_id('multiple_2')
135 self.assertEquals(set(['empty', 'fields']), set(record.tags)) 135 self.assertEquals(set(['empty', 'fields']), set(record.tags))
136 self.assertEquals({}, record.fields) 136 self.assertEquals({}, record.fields)
OLDNEW
« no previous file with comments | « no previous file | appengine/chromium_cq_status/tests/query_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698