Пример #1
0
def test_init_new_repo(tmp_path):
    repo_path, repo_data_dir = get_repo_path_tmp_path(tmp_path)
    assert not os.path.exists(repo_data_dir)
    dolt = Dolt(repo_path)
    dolt.init_new_repo()
    assert os.path.exists(repo_data_dir)
    shutil.rmtree(repo_data_dir)
Пример #2
0
def init_repo(tmp_path) -> Dolt:
    repo_path, repo_data_dir = get_repo_path_tmp_path(tmp_path)
    assert not os.path.exists(repo_data_dir)
    repo = Dolt(repo_path)
    repo.init_new_repo()
    yield repo
    if os.path.exists(repo_data_dir):
        shutil.rmtree(repo_data_dir)