Add tests for verbosity mapping.

This commit is contained in:
Dan Helfman 2017-10-25 22:36:23 -07:00
parent 16f0a3976c
commit cc94e5f52f
2 changed files with 11 additions and 2 deletions

View 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

View File

@ -13,5 +13,3 @@ def verbosity_to_log_level(verbosity):
VERBOSITY_SOME: logging.INFO,
VERBOSITY_LOTS: logging.DEBUG,
}.get(verbosity, logging.ERROR)