From cbcfc8604fd19ed94a6a84bde387284af0987f61 Mon Sep 17 00:00:00 2001 From: profitroll Date: Sun, 8 Sep 2024 01:28:18 +0200 Subject: [PATCH] Changed testing method for Client.him_search() --- tests/test_client.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 734bc4c..c1471df 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -20,9 +20,12 @@ def test_board_departure(api_client: Client, sample_stop_id: str): def test_him_search(api_client: Client): - assert isinstance( - api_client.him_search(time_end=datetime.now() + timedelta(days=10))[0], Message - ) + response = api_client.him_search(time_end=datetime.now() + timedelta(days=10)) + + if len(response) != 0: + assert isinstance(response[0], Message) + else: + assert isinstance(response, list) def test_journey_detail(api_client: Client, sample_journey_id: str):