def test_configs_merge(self): filepath = os.path.abspath( os.path.join(__file__, os.path.pardir, "tests", "logging_config.json")) LogManager._read_config(filepath) self.assertDictEqual(LogManager.LOGGING_CONFIG.get("test_logger"), {"level": "ERROR"})
def test_configs_schema_validation(self): filepath = os.path.abspath( os.path.join(__file__, os.path.pardir, "tests", "erroneous_logging_config.json")) with self.assertRaises(ValidationError): LogManager._read_config(filepath) filepath = os.path.abspath( os.path.join(__file__, os.path.pardir, "tests", "logging_config.json")) LogManager._read_config(filepath)
def test_configs_read(self): filepath = os.path.abspath( os.path.join(__file__, os.path.pardir, "tests", "does_not_exist.json")) with self.assertRaises(IOError): LogManager.init_base_logging(config_location=filepath) filepath = os.path.abspath( os.path.join(__file__, os.path.pardir, "tests", "logging_config.json")) LogManager._read_config(filepath)