Browse Source

Add tests for verbosity mapping.

master
Dan Helfman 1 year 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 @@
1
+import logging
2
+
3
+from borgmatic import verbosity as module
4
+
5
+
6
+def test_verbosity_to_log_level_maps_known_verbosity_to_log_level():
7
+    assert module.verbosity_to_log_level(module.VERBOSITY_SOME) == logging.INFO
8
+
9
+
10
+def test_verbosity_to_log_level_maps_unknown_verbosity_to_error_level():
11
+    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):
13 13
         VERBOSITY_SOME: logging.INFO,
14 14
         VERBOSITY_LOTS: logging.DEBUG,
15 15
     }.get(verbosity, logging.ERROR)
16
-
17
-

Loading…
Cancel
Save