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_empty(repo: RemoteFileRepo): assert repo.list_local() == []