From c631097edf5c4ef9883fa348810a3b140b0ff62c Mon Sep 17 00:00:00 2001 From: Zoheb Shaikh Date: Fri, 6 Sep 2024 12:54:32 +0100 Subject: [PATCH] moved string check to None --- src/blueapi/client/client.py | 2 +- tests/unit_tests/client/test_client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blueapi/client/client.py b/src/blueapi/client/client.py index a9cdd5f9f..97dbf35a5 100644 --- a/src/blueapi/client/client.py +++ b/src/blueapi/client/client.py @@ -143,7 +143,7 @@ def get_task(self, task_id: str) -> TrackableTask[Task]: Returns: TrackableTask[Task]: Task details """ - assert task_id != "", "Task ID cannot be empty" + assert task_id, "Task ID not provided!" return self._rest.get_task(task_id) def get_all_tasks(self) -> TasksListResponse: diff --git a/tests/unit_tests/client/test_client.py b/tests/unit_tests/client/test_client.py index b9385fc3b..f2ea986fd 100644 --- a/tests/unit_tests/client/test_client.py +++ b/tests/unit_tests/client/test_client.py @@ -148,7 +148,7 @@ def test_get_nonexistent_task( def test_get_task_with_empty_id(client: BlueapiClient): with pytest.raises(AssertionError) as exc: client.get_task("") - assert str(exc) == "Task ID cannot be empty" + assert str(exc) == "Task ID not provided!" def test_get_all_tasks(