diff options
author | Frederick Yin <fkfd@fkfd.me> | 2021-10-23 16:48:15 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2021-10-23 20:03:44 +0800 |
commit | 5a118df3f90bd5ab3f39c12487ea1f578aa380ae (patch) | |
tree | dd2b706176b55e2a56323c94ec76d90114cd505e /jimbrella/test/test_routine.py | |
parent | 5c5a70815ee389a89625be08d336afbdad8cb329 (diff) |
Routine logging and test thereof
Diffstat (limited to 'jimbrella/test/test_routine.py')
-rw-r--r-- | jimbrella/test/test_routine.py | 11 |
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 -----") |