From 5a118df3f90bd5ab3f39c12487ea1f578aa380ae Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Sat, 23 Oct 2021 16:48:15 +0800 Subject: Routine logging and test thereof --- jimbrella/test/test_routine.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'jimbrella/test/test_routine.py') 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 -----") -- cgit v1.2.3