From 7fa62da881c11df2dd611e5650240a704d0732f7 Mon Sep 17 00:00:00 2001 From: Simon Prickett Date: Thu, 13 Jan 2022 17:08:46 +0000 Subject: [PATCH 1/2] Linter fixes. --- aredis_om/checks.py | 2 ++ tests/test_hash_model.py | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/aredis_om/checks.py b/aredis_om/checks.py index a274f14..78aa75c 100644 --- a/aredis_om/checks.py +++ b/aredis_om/checks.py @@ -9,6 +9,7 @@ async def check_for_command(conn, cmd): cmd_info = await conn.execute_command("command", "info", cmd) return not None in cmd_info + @lru_cache(maxsize=None) async def has_redis_json(conn=None): if conn is None: @@ -16,6 +17,7 @@ async def has_redis_json(conn=None): command_exists = await check_for_command(conn, "json.set") return command_exists + @lru_cache(maxsize=None) async def has_redisearch(conn=None): if conn is None: diff --git a/tests/test_hash_model.py b/tests/test_hash_model.py index 134bc0e..9a9291a 100644 --- a/tests/test_hash_model.py +++ b/tests/test_hash_model.py @@ -128,22 +128,20 @@ async def test_exact_match_queries(members, m): ).all() assert actual == [member2] + @pytest.mark.asyncio async def test_full_text_search_queries(members, m): member1, member2, member3 = members - actual = await ( - m.Member.find(m.Member.bio % "great").all() - ) + actual = await (m.Member.find(m.Member.bio % "great").all()) assert actual == [member1] - actual = await ( - m.Member.find(~(m.Member.bio % "anxious")).all() - ) + actual = await (m.Member.find(~(m.Member.bio % "anxious")).all()) assert actual == [member1, member3] + @pytest.mark.asyncio async def test_recursive_query_resolution(members, m): member1, member2, member3 = members From 275aff2902d8c5fa411e4f79ab319be605d12302 Mon Sep 17 00:00:00 2001 From: Simon Prickett Date: Thu, 13 Jan 2022 17:10:51 +0000 Subject: [PATCH 2/2] Fixed linter issue. --- aredis_om/checks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aredis_om/checks.py b/aredis_om/checks.py index 78aa75c..be2332c 100644 --- a/aredis_om/checks.py +++ b/aredis_om/checks.py @@ -7,7 +7,7 @@ from aredis_om.connections import get_redis_connection @lru_cache(maxsize=None) async def check_for_command(conn, 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)