コード例 #1
0
ファイル: fixtures.py プロジェクト: lucab/doltpy
def init_empty_test_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.init(repo_path, ServerConfig(loglevel='trace', timeout=1000000))
    yield repo
    if os.path.exists(repo_data_dir):
        shutil.rmtree(repo_data_dir)
コード例 #2
0
def init_empty_test_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.init(repo_path)
    yield repo
    if os.path.exists(repo_data_dir):
        shutil.rmtree(repo_data_dir)
コード例 #3
0
ファイル: fixtures.py プロジェクト: lucab/doltpy
def init_other_empty_test_repo(tmp_path) -> Dolt:
    repo_path, repo_data_dir = get_repo_path_tmp_path(tmp_path, 'other')
    assert not os.path.exists(repo_data_dir)
    os.mkdir(repo_path)
    repo = Dolt.init(repo_path, ServerConfig(port=3307))
    yield repo
    if os.path.exists(repo_data_dir):
        shutil.rmtree(repo_data_dir)
コード例 #4
0
def test_init(tmp_path):
    repo_path, repo_data_dir = get_repo_path_tmp_path(tmp_path)
    assert not os.path.exists(repo_data_dir)
    Dolt.init(repo_path)
    assert os.path.exists(repo_data_dir)
    shutil.rmtree(repo_data_dir)