Skip to content

Commit 99827e4

Browse files
committed
Add tests for new function
1 parent c7f216b commit 99827e4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/unittests/util_test.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import logging
2+
3+
import pytest
4+
5+
from nav.util import check_log_level
6+
7+
8+
class TestCheckLogLevel:
9+
def test_actual_loglevel_above_input_should_return_false(self, *_):
10+
logger = logging.getLogger()
11+
logger.setLevel(logging.INFO)
12+
assert check_log_level(logger, logging.DEBUG) is False
13+
14+
def test_actual_loglevel_below_input_should_return_true(self, *_):
15+
logger = logging.getLogger()
16+
logger.setLevel(logging.INFO)
17+
assert check_log_level(logger, logging.WARNING)

0 commit comments

Comments
 (0)