summaryrefslogtreecommitdiff
path: root/jimbrella/test/test_routine.py
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2021-10-29 14:53:18 +0800
committerFrederick Yin <fkfd@fkfd.me>2021-10-29 14:53:18 +0800
commitf56dfc7e850ad4b4c33f35b24a712d7f92a23454 (patch)
tree5fc68e53d5e58a3761a222b9389553c4c1d47aa5 /jimbrella/test/test_routine.py
parent0f11b95cf154fb93d3e4c943027e594cde845da1 (diff)
Admin logging in routine
Also, path to test database is changed, and so are the arguments passed to db.give_back.
Diffstat (limited to 'jimbrella/test/test_routine.py')
-rw-r--r--jimbrella/test/test_routine.py7
1 files changed, 5 insertions, 2 deletions
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"""