From 75a13f80d3ff4247a3ad8ea81d37e3f69398a301 Mon Sep 17 00:00:00 2001 From: Joe Weiss Date: Thu, 23 Jun 2022 09:11:55 -0400 Subject: [PATCH] Move notifications utility into script.utils --- scripts/server.py | 2 +- scripts/{ => utils}/notifications.py | 0 tests/test_apprise_notifications.py | 5 +++-- 3 files changed, 4 insertions(+), 3 deletions(-) rename scripts/{ => utils}/notifications.py (100%) diff --git a/scripts/server.py b/scripts/server.py index c7e5ffe..239432f 100755 --- a/scripts/server.py +++ b/scripts/server.py @@ -14,7 +14,7 @@ import socket import threading import os -from notifications import sendAppriseNotifications +from utils.notifications import sendAppriseNotifications from utils.parse_settings import config_to_settings os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' diff --git a/scripts/notifications.py b/scripts/utils/notifications.py similarity index 100% rename from scripts/notifications.py rename to scripts/utils/notifications.py diff --git a/tests/test_apprise_notifications.py b/tests/test_apprise_notifications.py index b2c5300..b17c389 100644 --- a/tests/test_apprise_notifications.py +++ b/tests/test_apprise_notifications.py @@ -2,7 +2,7 @@ import os import sqlite3 import pytest -from scripts.notifications import sendAppriseNotifications +from scripts.utils.notifications import sendAppriseNotifications from datetime import datetime, timedelta def create_test_db(db_file): @@ -38,8 +38,9 @@ def clean_up_after_each_test(): yield os.remove("test.db") + def test_notifications(mocker): - notify_call = mocker.patch('scripts.notifications.notify') + notify_call = mocker.patch('scripts.utils.notifications.notify') create_test_db("test.db") settings_dict = { "APPRISE_NOTIFICATION_TITLE": "New backyard bird!",