def test_load_config_yaml_error(exists: MagicMock, isfile: MagicMock, makedirs: MagicMock, open: MagicMock, yaml_load: MagicMock, write_config: MagicMock, safe_print: MagicMock):
    exists.return_value = True
    isfile.return_value = True
    yaml_load.side_effect = yaml.error.YAMLError()

    with pytest.raises(exceptions.ConfigParseException):
        config_management.load_config()

    makedirs.assert_not_called()
    open.assert_called_once()
def test_load_config(exists: MagicMock, isfile: MagicMock, makedirs: MagicMock, open: MagicMock, yaml_load: MagicMock):
    exists.return_value = True
    isfile.return_value = True
    yaml_load.return_value = {'key': 'value'}

    result = config_management.load_config()

    assert result == yaml_load.return_value
    makedirs.assert_not_called()
def test_load_config_no_path(exists: MagicMock, isfile: MagicMock, makedirs: MagicMock, open: MagicMock, yaml_load: MagicMock):
    exists.return_value = False
    isfile.return_value = True
    yaml_load.return_value = {'key': 'value'}

    result = config_management.load_config()

    assert result == yaml_load.return_value
    makedirs.assert_called()
    open.assert_called_once()
    assert makedirs.call_count == 2