@@ -43,6 +43,14 @@ def test_mset(self, cache: ClusterValkeyCache):
4343 res = cache .mget (["a{foo}" , "b{foo}" , "c{foo}" ])
4444 assert res == {"a{foo}" : 1 , "b{foo}" : 2 , "c{foo}" : 3 }
4545
46+ def test_msetnx (self , cache : ClusterValkeyCache ):
47+ cache .mset ({"a{foo}" : 1 , "b{foo}" : 2 , "c{foo}" : 3 })
48+ res = cache .mget (["a{foo}" , "b{foo}" , "c{foo}" ])
49+ assert res == {"a{foo}" : 1 , "b{foo}" : 2 , "c{foo}" : 3 }
50+ cache .msetnx ({"a{foo}" : 3 , "new{foo}" : 1 , "other{foo}" : 1 })
51+ res = cache .mget (["a{foo}" , "new{foo}" , "other{foo}" ])
52+ assert res == {"a{foo}" : 1 }
53+
4654 def test_delete_pattern (self , cache : ClusterValkeyCache ):
4755 for key in ["foo-aa" , "foo-ab" , "foo-bb" , "foo-bc" ]:
4856 cache .set (key , "foo" )
@@ -147,3 +155,12 @@ def test_sunionstore(self, cache: ClusterValkeyCache):
147155 cache .sadd ("{foo}2" , "bar2" , "bar3" )
148156 assert cache .sunionstore ("{foo}3" , "{foo}1" , "{foo}2" ) == 3
149157 assert cache .smembers ("{foo}3" ) == {"bar1" , "bar2" , "bar3" }
158+
159+ def test_flushall (self , cache : ClusterValkeyCache ):
160+ cache .set ("{foo}a" , 1 )
161+ cache .sadd ("{foo}1" , "bar1" , "bar2" )
162+ cache .hset ("foo_hash1" , "foo1" , "bar1" )
163+ cache .flushall ()
164+ assert not cache .get ("{foo}a" )
165+ assert cache .smembers ("{foo}a" ) == set ()
166+ assert not cache .hexists ("foo_hash1" , "foo1" )
0 commit comments