From 490893397e835963c9c6469f57091ad85010385c Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Mon, 30 Oct 2023 16:30:06 -0400 Subject: [PATCH] Fixed isinstance() calls, oops Signed-off-by: Carlo Costino --- app/dao/date_util.py | 2 +- tests/app/clients/test_document_download.py | 8 ++++---- tests/app/test_model.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/dao/date_util.py b/app/dao/date_util.py index 8bacdcb0c..b338703c4 100644 --- a/app/dao/date_util.py +++ b/app/dao/date_util.py @@ -60,7 +60,7 @@ def get_current_calendar_year_start_year(): def get_calendar_year_for_datetime(start_date): - if isinstance(start_date) == date: + if isinstance(start_date, date): start_date = datetime.combine(start_date, time.min) year = int(start_date.strftime("%Y")) diff --git a/tests/app/clients/test_document_download.py b/tests/app/clients/test_document_download.py index be8f38e40..8cc891b76 100644 --- a/tests/app/clients/test_document_download.py +++ b/tests/app/clients/test_document_download.py @@ -75,8 +75,8 @@ def test_should_raise_non_400_statuses_as_exceptions(document_download): document_download.upload_document("service-id", "abababab") - assert ( - isinstance(excinfo.value) == Exception + assert isinstance( + excinfo.value, Exception ) # make sure it's a base exception, so will be handled as a 500 by v2 api assert ( str(excinfo.value) @@ -97,7 +97,7 @@ def test_should_raise_exceptions_without_http_response_bodies_as_exceptions( document_download.upload_document("service-id", "abababab") - assert ( - isinstance(excinfo.value) == Exception + assert isinstance( + excinfo.value, Exception ) # make sure it's a base exception, so will be handled as a 500 by v2 api assert str(excinfo.value) == "Unhandled document download error: ConnectTimeout()" diff --git a/tests/app/test_model.py b/tests/app/test_model.py index bdfc4c6cb..e2a2d1221 100644 --- a/tests/app/test_model.py +++ b/tests/app/test_model.py @@ -403,7 +403,7 @@ def test_notification_get_created_by_email_address(sample_notification, sample_u def test_notification_history_from_original(sample_notification): history = NotificationHistory.from_original(sample_notification) - assert isinstance(history) == NotificationHistory + assert isinstance(history, NotificationHistory) def test_rate_str():