From f77c1d13158acbeaf2714f41671c0d509281ff9c Mon Sep 17 00:00:00 2001 From: Nihal Mehta Date: Fri, 24 Jan 2025 22:50:18 +0000 Subject: [PATCH] Add dump and restore test Signed-off-by: Nihal Mehta --- tests/test_bloom_basic.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_bloom_basic.py b/tests/test_bloom_basic.py index 9508bfc..571a059 100644 --- a/tests/test_bloom_basic.py +++ b/tests/test_bloom_basic.py @@ -364,3 +364,11 @@ def test_bloom_string_config_set(self): assert self.client.execute_command('CONFIG SET bf.bloom-tightening-ratio 1.75') == b'ERR (0 < tightening ratio range < 1)' except ResponseError as e: assert str(e) == f"CONFIG SET failed (possibly related to argument 'bf.bloom-tightening-ratio') - ERR (0 < tightening ratio range < 1)" + + def test_bloom_dump_and_restore(self): + client = self.server.get_new_client() + client.execute_command('BF.INSERT dump error 0.001 capacity 2000 items 1') + dump = client.execute_command('DUMP dump') + assert client.execute_command('DEL dump') == 1 + client.execute_command('RESTORE', 'dump', 0, dump) + assert client.execute_command('BF.EXISTS dump 1') == 1