Skip to content

Commit 20efd95

Browse files
authored
Add dump and restore test (#42)
Signed-off-by: Nihal Mehta <[email protected]>
1 parent 591ab10 commit 20efd95

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_bloom_basic.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,15 @@ def test_bloom_string_config_set(self):
364364
assert self.client.execute_command('CONFIG SET bf.bloom-tightening-ratio 1.75') == b'ERR (0 < tightening ratio range < 1)'
365365
except ResponseError as e:
366366
assert str(e) == f"CONFIG SET failed (possibly related to argument 'bf.bloom-tightening-ratio') - ERR (0 < tightening ratio range < 1)"
367+
368+
def test_bloom_dump_and_restore(self):
369+
"""
370+
This is a test that validates the bloom data has same debug digest value before and after using restore command
371+
"""
372+
client = self.server.get_new_client()
373+
client.execute_command('BF.INSERT original error 0.001 capacity 2000 items 1')
374+
dump = client.execute_command('DUMP original')
375+
dump_digest = client.execute_command('DEBUG DIGEST-VALUE original')
376+
client.execute_command('RESTORE', 'copy', 0, dump)
377+
restore_digest = client.execute_command('DEBUG DIGEST-VALUE copy')
378+
assert restore_digest == dump_digest

0 commit comments

Comments
 (0)