Skip to content

Commit

Permalink
Add tests for new function
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed Nov 17, 2023
1 parent c7f216b commit 99827e4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/unittests/util_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import logging

import pytest

from nav.util import check_log_level


class TestCheckLogLevel:
def test_actual_loglevel_above_input_should_return_false(self, *_):
logger = logging.getLogger()
logger.setLevel(logging.INFO)
assert check_log_level(logger, logging.DEBUG) is False

def test_actual_loglevel_below_input_should_return_true(self, *_):
logger = logging.getLogger()
logger.setLevel(logging.INFO)
assert check_log_level(logger, logging.WARNING)

0 comments on commit 99827e4

Please sign in to comment.