This commit is contained in:
mcguirepr89
2022-06-24 09:23:33 -04:00
parent 5a971cea41
commit 8c5e9f38fa
+5 -3
View File
@@ -3,7 +3,8 @@ import sqlite3
import pytest
from scripts.utils.notifications import sendAppriseNotifications
from datetime import datetime, timedelta
from datetime import datetime
def create_test_db(db_file):
""" create a database connection to a SQLite database """
@@ -26,7 +27,7 @@ def create_test_db(db_file):
cur.execute(sql, ["Great Crested Flycatcher", today])
conn.commit()
except Error as e:
except Exception as e:
print(e)
finally:
if conn:
@@ -72,7 +73,8 @@ def test_notifications(mocker):
notify_call.call_args_list[0][0][0] == "A Great Crested Flycatcher (Myiarchus crinitus) was just detected with a confidence of 91 (first time today)"
)
assert(
notify_call.call_args_list[1][0][0] == "A Great Crested Flycatcher (Myiarchus crinitus) was just detected with a confidence of 91 (only seen 1 times in last 7d)"
notify_call.call_args_list[1][0][0] == "A Great Crested Flycatcher (Myiarchus crinitus) \
was just detected with a confidence of 91 (only seen 1 times in last 7d)"
)
# Add each species notification.