Skip to content

Commit

Permalink
feat:add async-type test
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Aug 27, 2023
1 parent 94784c9 commit 7817f46
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test_redis_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,22 @@ async def test_disconnect_server(req_aioredis2, fake_server):
fake_server.connected = True


async def test_type(req_aioredis2: redis.asyncio.Redis):
r = req_aioredis2
await r.set('string_key', "value")
await r.lpush("list_key", "value")
await r.sadd("set_key", "value")
await r.zadd("zset_key", {"value": 1})
await r.hset('hset_key', 'key', 'value')

assert b'string' == await r.type('string_key') # noqa: E721
assert b'list' == await r.type('list_key') # noqa: E721
assert b'set' == await r.type('set_key') # noqa: E721
assert b'zset' == await r.type('zset_key') # noqa: E721
assert b'hash' == await r.type('hset_key') # noqa: E721
assert b'none' == await r.type('none_key') # noqa: E721


async def test_xdel(req_aioredis2: redis.asyncio.Redis):
stream = "stream"

Expand Down

0 comments on commit 7817f46

Please sign in to comment.