def test_clean(repo: RemoteFileRepo, expected_files):
    for file in expected_files:
        repo.get(file)

    assert set(repo.list_local()) == set(expected_files)

    local_paths = [repo.get(file) for file in expected_files]
    for path in local_paths:
        assert os.path.isfile(path)

    repo.clean()
    assert repo.list_local() == []
    for path in local_paths:
        assert not os.path.exists(path)
def test_delete(repo: RemoteFileRepo, expected_file):
    model_file_path = repo.get(expected_file)
    repo.delete(expected_file)

    assert not repo.is_local(expected_file)
    assert repo.list_local() == []
    assert not os.path.exists(model_file_path)
def test_download(repo: RemoteFileRepo, expected_file):
    assert not repo.is_local(expected_file)

    model_file_path = repo.download(expected_file)
    assert repo.is_local(expected_file)
    assert os.path.isfile(model_file_path)
    assert repo.list_local() == [expected_file]
    assert repo.get(expected_file) == model_file_path
def test_autoload(repo: RemoteFileRepo, expected_file):
    assert not repo.is_local(expected_file)

    file_path = repo.get(expected_file)
    assert repo.is_local(expected_file)
    assert os.path.exists(file_path)
def test_content(repo: RemoteFileRepo, expected_file, expected_content):
    file_path = repo.get(expected_file)
    with open(file_path, 'r') as file:
        assert file.read() == expected_content