Browse files

added test to prove PYCBC-16 is fixed

Change-Id: I9af9505dba5948b5782880b9b470a42af5980d60
Reviewed-on: http://review.couchbase.org/20369
Reviewed-by: Benjamin Young <benjamin@couchbase.com>
Tested-by: Benjamin Young <benjamin@couchbase.com>
  • Loading branch information...
1 parent de22c75 commit 223478070f15da6df02fb3e0a3a9f3997a0931ee @BigBlueHat BigBlueHat committed with BigBlueHat Jun 1, 2012
Showing with 20 additions and 1 deletion.
  1. +20 −1 couchbase/tests/test_couchbaseclient.py
View
21 couchbase/tests/test_couchbaseclient.py
@@ -58,7 +58,26 @@ def test_set_integer_value(self):
'value should be the integer 11')
self.client.delete('int')
- @attr(cbv="1.0.0")
+ def test_two_client_incr(self):
+ """http://www.couchbase.com/issues/browse/PYCBC-16"""
+ key = 'test_two_client_incr'
+ client_one = self.client
+ client_two = CouchbaseClient(self.url, self.bucket_name, "", True)
+ # Client one sets a numeric key
+ client_one.set(key, 0, 0, 20)
+ # Client two tries to increment this numeric key
+ (i, cas) = client_two.incr(key)
+ self.assertEqual(i, 21)
+
+ # Client two should be able to keep incrementing this key
+ (i, cas) = client_two.incr(key)
+ self.assertEqual(i, 22)
+
+ (_, cas, i) = client_two.get(key)
+ self.assertEqual(i, 22)
+ (i, cas) = client_two.incr(key)
+ self.assertEqual(i, 23)
+
def test_bucket_of_type_memcached(self):
self.setup_memcached_bucket()
self.assertIsInstance(self.client_for_memcached_bucket,

0 comments on commit 2234780

Please sign in to comment.