From c1280700137390e98017f251ed26a0a656fa49d9 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 10 Mar 2021 12:51:53 +0300 Subject: Update test to ensure redis.hset is called correctly --- tests/unit/test_commands.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/unit/test_commands.py b/tests/unit/test_commands.py index c51118d..aafb3a2 100644 --- a/tests/unit/test_commands.py +++ b/tests/unit/test_commands.py @@ -81,9 +81,9 @@ class TestCommands(unittest.TestCase): job_queue="GN2::job-queue"), actual_unique_id) mock_redis_conn.hset.assert_has_calls( - [mock.call("cmd", "ls", actual_unique_id), - mock.call("result", "", actual_unique_id), - mock.call("status", "queued", actual_unique_id)]) + [mock.call(name=actual_unique_id, key="cmd", value="ls"), + mock.call(name=actual_unique_id, key="result", value=""), + mock.call(name=actual_unique_id, key="status", value="queued")]) mock_redis_conn.rpush.assert_has_calls( [mock.call("GN2::job-queue", actual_unique_id)]) @@ -107,10 +107,11 @@ class TestCommands(unittest.TestCase): email="me@me.com"), actual_unique_id) mock_redis_conn.hset.assert_has_calls( - [mock.call("cmd", "ls", actual_unique_id), - mock.call("result", "", actual_unique_id), - mock.call("status", "queued", actual_unique_id), - mock.call("email", "me@me.com", actual_unique_id)]) + [mock.call(name=actual_unique_id, key="cmd", value="ls"), + mock.call(name=actual_unique_id, key="result", value=""), + mock.call(name=actual_unique_id, key="status", value="queued"), + mock.call(name=actual_unique_id, key="email", value="me@me.com") + ]) mock_redis_conn.rpush.assert_has_calls( [mock.call("GN2::job-queue", actual_unique_id)]) -- cgit v1.2.3