summaryrefslogtreecommitdiff
path: root/jimbrella/test
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2021-10-23 16:48:15 +0800
committerFrederick Yin <fkfd@fkfd.me>2021-10-23 20:03:44 +0800
commit5a118df3f90bd5ab3f39c12487ea1f578aa380ae (patch)
treedd2b706176b55e2a56323c94ec76d90114cd505e /jimbrella/test
parent5c5a70815ee389a89625be08d336afbdad8cb329 (diff)
Routine logging and test thereof
Diffstat (limited to 'jimbrella/test')
-rw-r--r--jimbrella/test/test_routine.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/jimbrella/test/test_routine.py b/jimbrella/test/test_routine.py
index 5a08fdf..2a65b35 100644
--- a/jimbrella/test/test_routine.py
+++ b/jimbrella/test/test_routine.py
@@ -3,12 +3,22 @@ from threading import Thread
import json
import os
import shutil
+import logging
from .jform_data import mock_jform_data
from ..routine import sync_database, process_overdue
from ..database import Database
from ..jform import JForm
from ..config import *
+"""Set up logging."""
+logging.basicConfig(
+ filename="/tmp/jimbrella.log",
+ encoding="utf-8",
+ level=logging.INFO,
+ format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s",
+)
+logging.info("----- BEGIN ROUTINE TEST -----")
+
"""Spin up a simple Flask app to mimic jForm."""
jform = Flask(__name__)
@@ -59,3 +69,4 @@ process_overdue(db)
"""Cleanup"""
os.remove(takeaway_jform._bookmark_fp)
os.remove(giveback_jform._bookmark_fp)
+logging.info("----- END ROUTINE TEST -----")