2022-07-24 23:56:32 +02:00
|
|
|
import pytest
|
|
|
|
from pathlib import Path
|
|
|
|
|
2022-07-26 22:04:51 +02:00
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def support_data_path() -> Path:
|
|
|
|
path = Path(__file__).parent.parent.joinpath("_support_data")
|
|
|
|
return path
|
|
|
|
|
|
|
|
|
2022-07-24 23:56:32 +02:00
|
|
|
@pytest.fixture
|
|
|
|
def cloner_dir_struct(tmp_path: Path) -> Path:
|
|
|
|
tmp_path.joinpath("config").mkdir()
|
|
|
|
tmp_path.joinpath("cache").mkdir()
|
|
|
|
tmp_path.joinpath("repos").mkdir()
|
|
|
|
return tmp_path
|
|
|
|
|
|
|
|
|
2022-07-26 22:04:51 +02:00
|
|
|
@pytest.fixture
|
|
|
|
def cloner_dir_with_config(cloner_dir_struct: Path) -> Path:
|
|
|
|
cfg_file = cloner_dir_struct.joinpath("config", "cloner.cfg")
|
|
|
|
cfg_file.touch()
|
|
|
|
cfg_file.write_text("# cloner.cfg"
|
|
|
|
"cloner_repo_url=https://git.sw3.cz/kamikaze/test-repo-base.git"
|
|
|
|
"cloner_project_name=test-repo"
|
|
|
|
)
|
|
|
|
return cloner_dir_struct
|
2022-07-27 12:52:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def path_repo_base(support_data_path: Path) -> Path:
|
|
|
|
return support_data_path.joinpath("test-repo-base")
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def path_repo_different_tags(support_data_path: Path) -> Path:
|
|
|
|
return support_data_path.joinpath("test-repo-different-tags")
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def path_repo_changed_branches(support_data_path: Path) -> Path:
|
|
|
|
return support_data_path.joinpath("test-repo-changed-branches")
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def path_repo_new_commits(support_data_path: Path) -> Path:
|
|
|
|
return support_data_path.joinpath("test-repo-new-commits")
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def path_repo_reduced(support_data_path: Path) -> Path:
|
|
|
|
return support_data_path.joinpath("test-repo-reduced")
|