|
|
@ -3,20 +3,13 @@ import logging
|
|
|
|
from bazarr.app.logger import UnwantedWaitressMessageFilter
|
|
|
|
from bazarr.app.logger import UnwantedWaitressMessageFilter
|
|
|
|
|
|
|
|
|
|
|
|
def test_true_for_bazarr():
|
|
|
|
def test_true_for_bazarr():
|
|
|
|
record = logging.makeLogRecord({
|
|
|
|
record = logging.LogRecord("", logging.INFO, "", 0, "a message from BAZARR for logging", (), None)
|
|
|
|
"level": logging.INFO,
|
|
|
|
|
|
|
|
"msg": "a message from BAZARR for logging"
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
assert UnwantedWaitressMessageFilter().filter(record)
|
|
|
|
assert UnwantedWaitressMessageFilter().filter(record)
|
|
|
|
|
|
|
|
|
|
|
|
def test_false_below_error():
|
|
|
|
def test_false_below_error():
|
|
|
|
record = logging.makeLogRecord({
|
|
|
|
record = logging.LogRecord("", logging.INFO, "", 0, "", (), None)
|
|
|
|
"level": logging.INFO
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
assert not UnwantedWaitressMessageFilter().filter(record)
|
|
|
|
assert not UnwantedWaitressMessageFilter().filter(record)
|
|
|
|
|
|
|
|
|
|
|
|
def test_true_error_up():
|
|
|
|
def test_true_error_up():
|
|
|
|
record = logging.makeLogRecord({
|
|
|
|
record = logging.LogRecord("", logging.CRITICAL, "", 0, "", (), None)
|
|
|
|
"level": logging.CRITICAL
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
assert UnwantedWaitressMessageFilter().filter(record)
|
|
|
|
assert UnwantedWaitressMessageFilter().filter(record)
|