@@ -799,13 +799,17 @@ def test_clear(self, cache: RedisCache):
799
799
assert value_from_cache_after_clear is None
800
800
801
801
def test_hset (self , cache : RedisCache ):
802
+ if isinstance (cache .client , ShardClient ):
803
+ pytest .skip ("ShardClient doesn't support get_client" )
802
804
cache .hset ("foo_hash1" , "foo1" , "bar1" )
803
805
cache .hset ("foo_hash1" , "foo2" , "bar2" )
804
806
assert cache .hlen ("foo_hash1" ) == 2
805
807
assert cache .hexists ("foo_hash1" , "foo1" )
806
808
assert cache .hexists ("foo_hash1" , "foo2" )
807
809
808
810
def test_hdel (self , cache : RedisCache ):
811
+ if isinstance (cache .client , ShardClient ):
812
+ pytest .skip ("ShardClient doesn't support get_client" )
809
813
cache .hset ("foo_hash2" , "foo1" , "bar1" )
810
814
cache .hset ("foo_hash2" , "foo2" , "bar2" )
811
815
assert cache .hlen ("foo_hash2" ) == 2
@@ -816,13 +820,17 @@ def test_hdel(self, cache: RedisCache):
816
820
assert cache .hexists ("foo_hash2" , "foo2" )
817
821
818
822
def test_hlen (self , cache : RedisCache ):
823
+ if isinstance (cache .client , ShardClient ):
824
+ pytest .skip ("ShardClient doesn't support get_client" )
819
825
assert cache .hlen ("foo_hash3" ) == 0
820
826
cache .hset ("foo_hash3" , "foo1" , "bar1" )
821
827
assert cache .hlen ("foo_hash3" ) == 1
822
828
cache .hset ("foo_hash3" , "foo2" , "bar2" )
823
829
assert cache .hlen ("foo_hash3" ) == 2
824
830
825
831
def test_hkeys (self , cache : RedisCache ):
832
+ if isinstance (cache .client , ShardClient ):
833
+ pytest .skip ("ShardClient doesn't support get_client" )
826
834
cache .hset ("foo_hash4" , "foo1" , "bar1" )
827
835
cache .hset ("foo_hash4" , "foo2" , "bar2" )
828
836
cache .hset ("foo_hash4" , "foo3" , "bar3" )
@@ -832,6 +840,8 @@ def test_hkeys(self, cache: RedisCache):
832
840
assert keys [i ] == f"foo{ i + 1 } "
833
841
834
842
def test_hexists (self , cache : RedisCache ):
843
+ if isinstance (cache .client , ShardClient ):
844
+ pytest .skip ("ShardClient doesn't support get_client" )
835
845
cache .hset ("foo_hash5" , "foo1" , "bar1" )
836
846
assert cache .hexists ("foo_hash5" , "foo1" )
837
847
assert not cache .hexists ("foo_hash5" , "foo" )
0 commit comments