|
| 1 | +from pathlib import Path |
| 2 | + |
| 3 | +import pytest |
| 4 | + |
| 5 | + |
| 6 | +@pytest.mark.parametrize( |
| 7 | + argnames="removed_relative_path", |
| 8 | + argvalues=[".gitlab-ci.yml", "bitbucket-pipelines.yml"] |
| 9 | +) |
| 10 | +@pytest.mark.parametrize( |
| 11 | + argnames="robust_demo__repository_provider", |
| 12 | + argvalues=["github"], |
| 13 | + indirect=True |
| 14 | +) |
| 15 | +def test_files_removed_for_github(robust_demo: Path, removed_relative_path: str) -> None: |
| 16 | + path: Path = robust_demo / removed_relative_path |
| 17 | + assert not path.exists() |
| 18 | + |
| 19 | + |
| 20 | +@pytest.mark.parametrize( |
| 21 | + argnames="removed_relative_path", |
| 22 | + argvalues=[".github", "bitbucket-pipelines.yml"] |
| 23 | +) |
| 24 | +@pytest.mark.parametrize( |
| 25 | + argnames="robust_demo__repository_provider", |
| 26 | + argvalues=["gitlab"], |
| 27 | + indirect=True |
| 28 | +) |
| 29 | +def test_files_removed_for_gitlab(robust_demo: Path, removed_relative_path: str) -> None: |
| 30 | + path: Path = robust_demo / removed_relative_path |
| 31 | + assert not path.exists() |
| 32 | + |
| 33 | + |
| 34 | +@pytest.mark.parametrize( |
| 35 | + argnames="removed_relative_path", |
| 36 | + argvalues=[".github", ".gitlab-ci.yml"] |
| 37 | +) |
| 38 | +@pytest.mark.parametrize( |
| 39 | + argnames="robust_demo__repository_provider", |
| 40 | + argvalues=["bitbucket"], |
| 41 | + indirect=True |
| 42 | +) |
| 43 | +def test_files_removed_for_bitbucket(robust_demo: Path, removed_relative_path: str) -> None: |
| 44 | + path: Path = robust_demo / removed_relative_path |
| 45 | + assert not path.exists() |
| 46 | + |
| 47 | + |
| 48 | +@pytest.mark.parametrize( |
| 49 | + argnames="removed_relative_path", |
| 50 | + argvalues=[ |
| 51 | + "rust", |
| 52 | + ".github/workflows/lint-rust.yml", |
| 53 | + ".github/workflows/build-rust.yml", |
| 54 | + ".github/workflows/test-rust.yml" |
| 55 | + ] |
| 56 | +) |
| 57 | +@pytest.mark.parametrize( |
| 58 | + argnames="robust_demo__add_rust_extension", |
| 59 | + argvalues=[False], |
| 60 | + indirect=True, |
| 61 | + ids=["no-rust"] |
| 62 | +) |
| 63 | +@pytest.mark.parametrize( |
| 64 | + argnames="robust_demo__repository_provider", |
| 65 | + argvalues=["github"], |
| 66 | + indirect=True, |
| 67 | +) |
| 68 | +def test_files_removed_for_no_rust_extension(robust_demo: Path, removed_relative_path: str) -> None: |
| 69 | + path: Path = robust_demo / removed_relative_path |
| 70 | + assert not path.exists() |
0 commit comments