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

Unified Diff: appengine/cr-buildbucket/test/api_test.py

Issue 2170673002: buildbucket: add longest_pending_time API (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: nits Created 4 years, 5 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 | « appengine/cr-buildbucket/service.py ('k') | appengine/cr-buildbucket/test/service_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/cr-buildbucket/test/api_test.py
diff --git a/appengine/cr-buildbucket/test/api_test.py b/appengine/cr-buildbucket/test/api_test.py
index e751bcb2a2e2df601666a02e0e43ddf5911e9500..4679456313dec368c16b45e450183e85f0c74415 100644
--- a/appengine/cr-buildbucket/test/api_test.py
+++ b/appengine/cr-buildbucket/test/api_test.py
@@ -620,6 +620,18 @@ class ApiTests(object):
service.get.side_effect = auth.AuthorizationError
self.call_api('get', {'id': 123}, status=403)
+ ############################# LONGEST_PENDING_TIME ###########################
+
+ def test_longest_pending_time(self):
+ service.longest_pending_time.return_value = datetime.timedelta(seconds=42)
+ req = {
+ 'bucket': 'chromium',
+ 'builder': 'x',
+ }
+ res = self.call_api('longest_pending_time', req).json_body
+ self.assertEqual(res['longest_pending_time_sec'], 42)
+ service.longest_pending_time.assert_called_once_with('chromium', 'x')
+
class EndpointsApiTest(testing.EndpointsTestCase, ApiTests):
api_service_cls = api.BuildBucketApi
« no previous file with comments | « appengine/cr-buildbucket/service.py ('k') | appengine/cr-buildbucket/test/service_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698