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 7, 2024
1 parent 65ff710 commit 67ada1f
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 67ada1f

Please sign in to comment.