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 Mar 1, 2024
1 parent 29f5859 commit c9763b9
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 c9763b9

Please sign in to comment.