Update the tests.

This commit is contained in:
hofmockel 2014-10-22 20:54:25 +02:00
parent 7e1df8bec1
commit 9cf520a77b
2 changed files with 6 additions and 12 deletions

View file

@ -340,6 +340,6 @@ class TestPrefixExtractor(unittest.TestCase, TestHelper):
it = self.db.iteritems() it = self.db.iteritems()
it.seek(b'00002') it.seek(b'00002')
ref = {'00002.z': 'z', '00002.y': 'y', '00002.x': 'x'} ref = {b'00002.z': b'z', b'00002.y': b'y', b'00002.x': b'x'}
ret = takewhile(lambda item: item[0].startswith(b'00002'), it) ret = takewhile(lambda item: item[0].startswith(b'00002'), it)
self.assertEqual(ref, dict(ret)) self.assertEqual(ref, dict(ret))

View file

@ -28,11 +28,6 @@ class TestOptions(unittest.TestCase):
opts.paranoid_checks = False opts.paranoid_checks = False
self.assertEqual(False, opts.paranoid_checks) self.assertEqual(False, opts.paranoid_checks)
self.assertIsNone(opts.filter_policy)
ob = TestFilterPolicy()
opts.filter_policy = ob
self.assertEqual(opts.filter_policy, ob)
self.assertIsNone(opts.merge_operator) self.assertIsNone(opts.merge_operator)
ob = TestMergeOperator() ob = TestMergeOperator()
opts.merge_operator = ob opts.merge_operator = ob
@ -46,12 +41,11 @@ class TestOptions(unittest.TestCase):
opts.compression = rocksdb.CompressionType.no_compression opts.compression = rocksdb.CompressionType.no_compression
self.assertEqual('no_compression', opts.compression) self.assertEqual('no_compression', opts.compression)
self.assertEqual(opts.block_size, 4096) def test_block_options(self):
rocksdb.BlockBasedTableFactory(
self.assertIsNone(opts.block_cache) block_size=4096,
ob = rocksdb.LRUCache(100) filter_policy=TestFilterPolicy(),
opts.block_cache = ob block_cache=rocksdb.LRUCache(100))
self.assertEqual(ob, opts.block_cache)
def test_unicode_path(self): def test_unicode_path(self):
name = b'/tmp/M\xc3\xbcnchen'.decode('utf8') name = b'/tmp/M\xc3\xbcnchen'.decode('utf8')