def test_load_configurations_logs_critical_for_parse_error(): flexmock(module.validate).should_receive('parse_configuration').and_raise(ValueError) configs, logs = tuple(module.load_configurations(('test.yaml',))) assert configs == {} assert {log.levelno for log in logs} == {logging.CRITICAL}
def test_load_configurations_collects_parsed_configurations(): configuration = flexmock() other_configuration = flexmock() flexmock(module.validate).should_receive('parse_configuration').and_return( configuration ).and_return(other_configuration) configs, logs = tuple(module.load_configurations(('test.yaml', 'other.yaml'))) assert configs == {'test.yaml': configuration, 'other.yaml': other_configuration} assert logs == []