Browse Source

Add tests for verbosity mapping.

master
Dan Helfman 2 years ago
parent
commit
cc94e5f52f
2 changed files with 11 additions and 2 deletions
  1. +11
    -0
      borgmatic/tests/unit/test_verbosity.py
  2. +0
    -2
      borgmatic/verbosity.py

+ 11
- 0
borgmatic/tests/unit/test_verbosity.py 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

+ 0
- 2
borgmatic/verbosity.py View File

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



Loading…
Cancel
Save