Update config handling for logging level, and add test
Set the default to CRITICAL only, to simplify code. Add check for the
specified logging level, and a unit test for that.
Change-Id: I3ffa467f001dfdfb840f312bf0df8265aac58299
diff --git a/config/test.py b/config/test.py
index 3d66aaf..a1edb22 100644
--- a/config/test.py
+++ b/config/test.py
@@ -40,6 +40,12 @@
config = VlanConfig(filenames=("test-invalid-vland.cfg",))
del config
+ # Check that we raise on broken logging level
+ def test_invalid_logging_level(self):
+ with self.assertRaisesRegexp(ConfigError, 'Invalid logging.*level'):
+ config = VlanConfig(filenames=("test-invalid-logging-level.cfg",))
+ del config
+
# Check that we raise on repeated switch names
def test_missing_repeated_switch_names(self):
with self.assertRaisesRegexp(ConfigError, 'same name'):