mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-10 10:03:38 -04:00
Fixed isinstance() calls, oops
Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
@@ -60,7 +60,7 @@ def get_current_calendar_year_start_year():
|
|||||||
|
|
||||||
|
|
||||||
def get_calendar_year_for_datetime(start_date):
|
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)
|
start_date = datetime.combine(start_date, time.min)
|
||||||
|
|
||||||
year = int(start_date.strftime("%Y"))
|
year = int(start_date.strftime("%Y"))
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ def test_should_raise_non_400_statuses_as_exceptions(document_download):
|
|||||||
|
|
||||||
document_download.upload_document("service-id", "abababab")
|
document_download.upload_document("service-id", "abababab")
|
||||||
|
|
||||||
assert (
|
assert isinstance(
|
||||||
isinstance(excinfo.value) == Exception
|
excinfo.value, Exception
|
||||||
) # make sure it's a base exception, so will be handled as a 500 by v2 api
|
) # make sure it's a base exception, so will be handled as a 500 by v2 api
|
||||||
assert (
|
assert (
|
||||||
str(excinfo.value)
|
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")
|
document_download.upload_document("service-id", "abababab")
|
||||||
|
|
||||||
assert (
|
assert isinstance(
|
||||||
isinstance(excinfo.value) == Exception
|
excinfo.value, Exception
|
||||||
) # make sure it's a base exception, so will be handled as a 500 by v2 api
|
) # 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()"
|
assert str(excinfo.value) == "Unhandled document download error: ConnectTimeout()"
|
||||||
|
|||||||
@@ -403,7 +403,7 @@ def test_notification_get_created_by_email_address(sample_notification, sample_u
|
|||||||
|
|
||||||
def test_notification_history_from_original(sample_notification):
|
def test_notification_history_from_original(sample_notification):
|
||||||
history = NotificationHistory.from_original(sample_notification)
|
history = NotificationHistory.from_original(sample_notification)
|
||||||
assert isinstance(history) == NotificationHistory
|
assert isinstance(history, NotificationHistory)
|
||||||
|
|
||||||
|
|
||||||
def test_rate_str():
|
def test_rate_str():
|
||||||
|
|||||||
Reference in New Issue
Block a user