From f56dfc7e850ad4b4c33f35b24a712d7f92a23454 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Fri, 29 Oct 2021 14:53:18 +0800 Subject: Admin logging in routine Also, path to test database is changed, and so are the arguments passed to db.give_back. --- jimbrella/test/test_routine.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'jimbrella/test') diff --git a/jimbrella/test/test_routine.py b/jimbrella/test/test_routine.py index 2a65b35..0b15717 100644 --- a/jimbrella/test/test_routine.py +++ b/jimbrella/test/test_routine.py @@ -8,6 +8,7 @@ from .jform_data import mock_jform_data from ..routine import sync_database, process_overdue from ..database import Database from ..jform import JForm +from ..admin_log import AdminLog from ..config import * """Set up logging.""" @@ -58,12 +59,14 @@ def api(endpoint): Thread(target=jform.run, kwargs={"port": 5001}).start() """Initialize Database and JForm.""" -TEST_DATABASE_PATH = "/tmp/jimbrella.test.db.csv" +TEST_DATABASE_PATH = "/tmp/jimbrella.db.csv" +TEST_ADMIN_LOG_PATH = "/tmp/jimbrella.admin.log" shutil.copyfile(DATABASE_PATH, TEST_DATABASE_PATH) db = Database(TEST_DATABASE_PATH) takeaway_jform = JForm("takeaway", "http://localhost:5001/takeaway", "/tmp") giveback_jform = JForm("giveback", "http://localhost:5001/giveback", "/tmp") -sync_database(takeaway_jform, giveback_jform, db) +admin = AdminLog(TEST_ADMIN_LOG_PATH) +sync_database(takeaway_jform, giveback_jform, db, admin) process_overdue(db) """Cleanup""" -- cgit v1.2.3