Add tests for verbosity mapping.
This commit is contained in:
parent
a09c9f248e
commit
2ae8ac2947
2 changed files with 11 additions and 2 deletions
11
borgmatic/tests/unit/test_verbosity.py
Normal file
11
borgmatic/tests/unit/test_verbosity.py
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from borgmatic import verbosity as module
|
||||||
|
|
||||||
|
|
||||||
|
def test_verbosity_to_log_level_maps_known_verbosity_to_log_level():
|
||||||
|
assert module.verbosity_to_log_level(module.VERBOSITY_SOME) == logging.INFO
|
||||||
|
|
||||||
|
|
||||||
|
def test_verbosity_to_log_level_maps_unknown_verbosity_to_error_level():
|
||||||
|
assert module.verbosity_to_log_level('my pants') == logging.ERROR
|
|
@ -13,5 +13,3 @@ def verbosity_to_log_level(verbosity):
|
||||||
VERBOSITY_SOME: logging.INFO,
|
VERBOSITY_SOME: logging.INFO,
|
||||||
VERBOSITY_LOTS: logging.DEBUG,
|
VERBOSITY_LOTS: logging.DEBUG,
|
||||||
}.get(verbosity, logging.ERROR)
|
}.get(verbosity, logging.ERROR)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue