Skip to content

Commit

Permalink
added test to prove PYCBC-16 is fixed
Browse files Browse the repository at this point in the history
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
BigBlueHat authored and Benjamin Young committed Sep 1, 2012
1 parent de22c75 commit 2234780
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion couchbase/tests/test_couchbaseclient.py
Expand Up @@ -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,
Expand Down

0 comments on commit 2234780

Please sign in to comment.