commit
93c2ea68e1
2 changed files with 7 additions and 7 deletions
|
@ -7,7 +7,8 @@ from aredis_om.connections import get_redis_connection
|
||||||
@lru_cache(maxsize=None)
|
@lru_cache(maxsize=None)
|
||||||
async def check_for_command(conn, cmd):
|
async def check_for_command(conn, cmd):
|
||||||
cmd_info = await conn.execute_command("command", "info", cmd)
|
cmd_info = await conn.execute_command("command", "info", cmd)
|
||||||
return not None in cmd_info
|
return None not in cmd_info
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize=None)
|
@lru_cache(maxsize=None)
|
||||||
async def has_redis_json(conn=None):
|
async def has_redis_json(conn=None):
|
||||||
|
@ -16,6 +17,7 @@ async def has_redis_json(conn=None):
|
||||||
command_exists = await check_for_command(conn, "json.set")
|
command_exists = await check_for_command(conn, "json.set")
|
||||||
return command_exists
|
return command_exists
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize=None)
|
@lru_cache(maxsize=None)
|
||||||
async def has_redisearch(conn=None):
|
async def has_redisearch(conn=None):
|
||||||
if conn is None:
|
if conn is None:
|
||||||
|
|
|
@ -128,22 +128,20 @@ async def test_exact_match_queries(members, m):
|
||||||
).all()
|
).all()
|
||||||
assert actual == [member2]
|
assert actual == [member2]
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_full_text_search_queries(members, m):
|
async def test_full_text_search_queries(members, m):
|
||||||
member1, member2, member3 = members
|
member1, member2, member3 = members
|
||||||
|
|
||||||
actual = await (
|
actual = await (m.Member.find(m.Member.bio % "great").all())
|
||||||
m.Member.find(m.Member.bio % "great").all()
|
|
||||||
)
|
|
||||||
|
|
||||||
assert actual == [member1]
|
assert actual == [member1]
|
||||||
|
|
||||||
actual = await (
|
actual = await (m.Member.find(~(m.Member.bio % "anxious")).all())
|
||||||
m.Member.find(~(m.Member.bio % "anxious")).all()
|
|
||||||
)
|
|
||||||
|
|
||||||
assert actual == [member1, member3]
|
assert actual == [member1, member3]
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_recursive_query_resolution(members, m):
|
async def test_recursive_query_resolution(members, m):
|
||||||
member1, member2, member3 = members
|
member1, member2, member3 = members
|
||||||
|
|
Loading…
Reference in a new issue