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

Side by Side Diff: appengine/chromium_try_flakes/findit/test/findit_test.py

Issue 2438673004: [Findit] Post analysis results of flakes to bug filed by chromium-try-flakes. (Closed)
Patch Set: Add a config flag to enable/disable updating monorail bug. Created 4 years, 1 month 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
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 datetime 5 import datetime
6 import mock 6 import mock
7 7
8 from google.appengine.datastore import datastore_stub_util 8 from google.appengine.datastore import datastore_stub_util
9 9
10 import main # Fiddles sys.path so must come first. 10 import main # Fiddles sys.path so must come first.
(...skipping 12 matching lines...) Expand all
23 datastore_stub_consistency_policy = ( 23 datastore_stub_consistency_policy = (
24 datastore_stub_util.PseudoRandomHRConsistencyPolicy(probability=1)) 24 datastore_stub_util.PseudoRandomHRConsistencyPolicy(probability=1))
25 25
26 def setUp(self): 26 def setUp(self):
27 super(FindItAPITestCase, self).setUp() 27 super(FindItAPITestCase, self).setUp()
28 gae_ts_mon.reset_for_unittest(disable=True) 28 gae_ts_mon.reset_for_unittest(disable=True)
29 self.maxDiff = None 29 self.maxDiff = None
30 self.client = mock.Mock() 30 self.client = mock.Mock()
31 self.build_client = mock.Mock(return_value=self.client) 31 self.build_client = mock.Mock(return_value=self.client)
32 self.patchers = [ 32 self.patchers = [
33 mock.patch('endpoints.endpoints.build_client', self.build_client), 33 mock.patch(
34 mock.patch('endpoints.endpoints.retry_request', mock.Mock()), 34 'endpoints_client.endpoints.build_client', self.build_client),
35 mock.patch('endpoints_client.endpoints.retry_request', mock.Mock()),
35 ] 36 ]
36 for patcher in self.patchers: 37 for patcher in self.patchers:
37 patcher.start() 38 patcher.start()
38 39
39 def tearDown(self): 40 def tearDown(self):
40 super(FindItAPITestCase, self).tearDown() 41 super(FindItAPITestCase, self).tearDown()
41 for patcher in self.patchers: 42 for patcher in self.patchers:
42 patcher.stop() 43 patcher.stop()
43 44
44 @staticmethod 45 @staticmethod
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 'appspot.com/_ah/api/discovery/v1/apis/{api}/{apiVersion}/rest') 113 'appspot.com/_ah/api/discovery/v1/apis/{api}/{apiVersion}/rest')
113 114
114 def test_uses_prod_instance_by_default(self): 115 def test_uses_prod_instance_by_default(self):
115 findit.FindItAPI() 116 findit.FindItAPI()
116 self.assertEquals(self.build_client.call_count, 1) 117 self.assertEquals(self.build_client.call_count, 1)
117 self.assertEquals(self.build_client.call_args[0][0], 'findit') 118 self.assertEquals(self.build_client.call_args[0][0], 'findit')
118 self.assertEquals(self.build_client.call_args[0][1], 'v1') 119 self.assertEquals(self.build_client.call_args[0][1], 'v1')
119 self.assertEquals( 120 self.assertEquals(
120 self.build_client.call_args[0][2], 'https://findit-for-me.appspot.com/' 121 self.build_client.call_args[0][2], 'https://findit-for-me.appspot.com/'
121 '_ah/api/discovery/v1/apis/{api}/{apiVersion}/rest') 122 '_ah/api/discovery/v1/apis/{api}/{apiVersion}/rest')
OLDNEW
« no previous file with comments | « appengine/chromium_try_flakes/findit/findit.py ('k') | appengine/chromium_try_flakes/issue_tracker/issue_tracker_api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698