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

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

Issue 1082303002: buildbucket: put_batch endpoint (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: memcache Created 5 years, 8 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
Index: appengine/cr-buildbucket/test/service_test.py
diff --git a/appengine/cr-buildbucket/test/service_test.py b/appengine/cr-buildbucket/test/service_test.py
index bdef6d14099d94b6ed668559bb8a992e4c8cf794..8c1bec6a5cb2e44e84b1043be57ea6fef1946152 100644
--- a/appengine/cr-buildbucket/test/service_test.py
+++ b/appengine/cr-buildbucket/test/service_test.py
@@ -8,6 +8,7 @@ import json
from components import auth
from components import utils
+from google.appengine.datastore import datastore_stub_util
from google.appengine.ext import testbed
from testing_utils import testing
import mock
@@ -29,6 +30,11 @@ class BuildBucketServiceTest(testing.AppengineTestCase):
self.mock(acl, 'can', can)
def setUp(self):
+ # Create a consistency policy that will simulate the High Replication
+ # consistency model.
+ self.consistency_policy = (
+ datastore_stub_util.PseudoRandomHRConsistencyPolicy(probability=1.0))
+
super(BuildBucketServiceTest, self).setUp()
self.service = service.BuildBucketService()
self.test_build = model.Build(
@@ -66,6 +72,20 @@ class BuildBucketServiceTest(testing.AppengineTestCase):
self.assertEqual(build.parameters, params)
self.assertEqual(build.created_by, auth.get_current_identity())
+ def test_add_with_client_operation_id(self):
+ build = self.service.add(
+ bucket='chromium',
+ parameters={'buildername': 'linux_rel'},
+ client_operation_id=1,
+ )
+ build2 = self.service.add(
+ bucket='chromium',
+ parameters={'buildername': 'linux_rel'},
+ client_operation_id=1,
+ )
+ self.assertIsNotNone(build.key)
+ self.assertEqual(build, build2)
+
def test_add_with_bad_bucket_name(self):
with self.assertRaises(errors.InvalidInputError):
self.service.add(bucket='chromium as')

Powered by Google App Engine
This is Rietveld 408576698