MCPcopy
hub / github.com/redis/redis-py / test_hsetnx

Method test_hsetnx

tests/test_commands.py:5476–5481  ·  view source on GitHub ↗
(self, r)

Source from the content-addressed store, hash-verified

5474 assert r.hgetall("a") == h
5475
5476 def test_hsetnx(self, r):
5477 # Initially set the hash field
5478 assert r.hsetnx("a", "1", 1)
5479 assert r.hget("a", "1") == b"1"
5480 assert not r.hsetnx("a", "1", 2)
5481 assert r.hget("a", "1") == b"1"
5482
5483 def test_hvals(self, r):
5484 h = {b"a1": b"1", b"a2": b"2", b"a3": b"3"}

Callers

nothing calls this directly

Calls 2

hsetnxMethod · 0.80
hgetMethod · 0.80

Tested by

no test coverage detected