Exemple #1
0
def test_get_data_directory_returns_path_to_data_directory_as_configured_in_config(
) -> None:
    with (Path.cwd() / "lean.json").open("w+", encoding="utf-8") as file:
        file.write('{ "data-folder": "sub1/sub2/sub3/data" }')

    manager = LeanConfigManager(mock.Mock(), ProjectConfigManager())

    assert manager.get_data_directory(
    ) == Path.cwd() / "sub1" / "sub2" / "sub3" / "data"
Exemple #2
0
def test_get_data_directory_returns_path_to_data_directory_when_config_contains_comments(
) -> None:
    with (Path.cwd() / "lean.json").open("w+", encoding="utf-8") as file:
        file.write("""
{
    // some comment about the data-folder
    "data-folder": "sub1/sub2/sub3/data"
}
        """)

    manager = LeanConfigManager(mock.Mock(), ProjectConfigManager())

    assert manager.get_data_directory(
    ) == Path.cwd() / "sub1" / "sub2" / "sub3" / "data"