diff options
author | Omar Pakker <[email protected]> | 2024-09-16 18:10:50 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-16 12:10:50 -0400 |
commit | cc7a8000e74c09ac2a747cf303ff86a48f37ec1e (patch) | |
tree | 9c77ec4a8b8fd67b08534e73393585ac7d4dec6c /tests | |
parent | 695887b58456f8e99ce9b2b54054e537100bc966 (diff) | |
download | bazarr-cc7a8000e74c09ac2a747cf303ff86a48f37ec1e.tar.gz bazarr-cc7a8000e74c09ac2a747cf303ff86a48f37ec1e.zip |
Fixed logging filter bug introduced in 1.4.4v1.4.5-beta.0
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_logging_filters.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_logging_filters.py b/tests/test_logging_filters.py new file mode 100644 index 000000000..9209fb09e --- /dev/null +++ b/tests/test_logging_filters.py @@ -0,0 +1,22 @@ +import logging + +from bazarr.app.logger import UnwantedWaitressMessageFilter + +def test_true_for_bazarr(): + record = logging.makeLogRecord({ + "level": logging.INFO, + "msg": "a message from BAZARR for logging" + }) + assert UnwantedWaitressMessageFilter().filter(record) + +def test_false_below_error(): + record = logging.makeLogRecord({ + "level": logging.INFO + }) + assert not UnwantedWaitressMessageFilter().filter(record) + +def test_true_error_up(): + record = logging.makeLogRecord({ + "level": logging.CRITICAL + }) + assert UnwantedWaitressMessageFilter().filter(record) |