basho/riak-python-client — Issue #96: test_generate_key fails
Author: pilt
Created: 2011-12-22 01:05:29+00:00
State: open

Latest Homebrew version of Riak used.

$ SKIP_LUWAK=1 SKIP_SEARCH=1 python riak/tests/test_all.py
ss......ssss....F..........................s....ssss.....ss....ssssssssssssssssssssssssssssssssssssssssssssss.......
======================================================================
FAIL: test_generate_key (__main__.RiakHttpTransportTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "riak/tests/test_all.py", line 935, in test_generate_key
self.assertEqual(len(bucket.get_keys()), 1)
AssertionError: 2 != 1

----------------------------------------------------------------------
Ran 116 tests in 1.417s

FAILED (failures=1, skipped=59)

Test method:

def test_generate_key(self):
# Ensure that Riak generates a random key when
# the key passed to bucket.new() is None.
bucket = self.client.bucket('random_key_bucket')
for key in bucket.get_keys():
bucket.get(str(key)).delete()
o = bucket.new(None, data={})
self.assertIsNone(o.get_key())
o.store()
self.assertIsNotNone(o.get_key())
self.assertNotIn('/', o.get_key())
self.assertEqual(len(bucket.get_keys()), 1)