Skip to content

Commit

Permalink
Skip sharded client in hashmap tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kysre committed Jan 29, 2024
1 parent 09e53a1 commit d08e922
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,13 +799,17 @@ def test_clear(self, cache: RedisCache):
assert value_from_cache_after_clear is None

def test_hset(self, cache: RedisCache):
if isinstance(cache.client, ShardClient):

Check warning on line 802 in tests/test_backend.py

View check run for this annotation

Codecov / codecov/patch

tests/test_backend.py#L801-L802

Added lines #L801 - L802 were not covered by tests
pytest.skip("ShardClient doesn't support get_client")
cache.hset("foo_hash1", "foo1", "bar1")
cache.hset("foo_hash1", "foo2", "bar2")
assert cache.hlen("foo_hash1") == 2
assert cache.hexists("foo_hash1", "foo1")
assert cache.hexists("foo_hash1", "foo2")

Check warning on line 808 in tests/test_backend.py

View check run for this annotation

Codecov / codecov/patch

tests/test_backend.py#L804-L808

Added lines #L804 - L808 were not covered by tests

def test_hdel(self, cache: RedisCache):
if isinstance(cache.client, ShardClient):

Check warning on line 811 in tests/test_backend.py

View check run for this annotation

Codecov / codecov/patch

tests/test_backend.py#L810-L811

Added lines #L810 - L811 were not covered by tests
pytest.skip("ShardClient doesn't support get_client")
cache.hset("foo_hash2", "foo1", "bar1")
cache.hset("foo_hash2", "foo2", "bar2")
assert cache.hlen("foo_hash2") == 2
Expand All @@ -816,13 +820,17 @@ def test_hdel(self, cache: RedisCache):
assert cache.hexists("foo_hash2", "foo2")

Check warning on line 820 in tests/test_backend.py

View check run for this annotation

Codecov / codecov/patch

tests/test_backend.py#L813-L820

Added lines #L813 - L820 were not covered by tests

def test_hlen(self, cache: RedisCache):
if isinstance(cache.client, ShardClient):

Check warning on line 823 in tests/test_backend.py

View check run for this annotation

Codecov / codecov/patch

tests/test_backend.py#L822-L823

Added lines #L822 - L823 were not covered by tests
pytest.skip("ShardClient doesn't support get_client")
assert cache.hlen("foo_hash3") == 0
cache.hset("foo_hash3", "foo1", "bar1")
assert cache.hlen("foo_hash3") == 1
cache.hset("foo_hash3", "foo2", "bar2")
assert cache.hlen("foo_hash3") == 2

Check warning on line 829 in tests/test_backend.py

View check run for this annotation

Codecov / codecov/patch

tests/test_backend.py#L825-L829

Added lines #L825 - L829 were not covered by tests

def test_hkeys(self, cache: RedisCache):
if isinstance(cache.client, ShardClient):

Check warning on line 832 in tests/test_backend.py

View check run for this annotation

Codecov / codecov/patch

tests/test_backend.py#L831-L832

Added lines #L831 - L832 were not covered by tests
pytest.skip("ShardClient doesn't support get_client")
cache.hset("foo_hash4", "foo1", "bar1")
cache.hset("foo_hash4", "foo2", "bar2")
cache.hset("foo_hash4", "foo3", "bar3")
Expand All @@ -832,6 +840,8 @@ def test_hkeys(self, cache: RedisCache):
assert keys[i] == f"foo{i + 1}"

Check warning on line 840 in tests/test_backend.py

View check run for this annotation

Codecov / codecov/patch

tests/test_backend.py#L834-L840

Added lines #L834 - L840 were not covered by tests

def test_hexists(self, cache: RedisCache):
if isinstance(cache.client, ShardClient):

Check warning on line 843 in tests/test_backend.py

View check run for this annotation

Codecov / codecov/patch

tests/test_backend.py#L842-L843

Added lines #L842 - L843 were not covered by tests
pytest.skip("ShardClient doesn't support get_client")
cache.hset("foo_hash5", "foo1", "bar1")
assert cache.hexists("foo_hash5", "foo1")
assert not cache.hexists("foo_hash5", "foo")

Check warning on line 847 in tests/test_backend.py

View check run for this annotation

Codecov / codecov/patch

tests/test_backend.py#L845-L847

Added lines #L845 - L847 were not covered by tests

0 comments on commit d08e922

Please sign in to comment.