Test that ``create_git_command`` builds the correct command list based on inputs.
(
base_cmd: list[str],
local_path: str,
url: str,
token: str | None,
expected_suffix: list[str],
)
| 85 | ], |
| 86 | ) |
| 87 | def test_create_git_command( |
| 88 | base_cmd: list[str], |
| 89 | local_path: str, |
| 90 | url: str, |
| 91 | token: str | None, |
| 92 | expected_suffix: list[str], |
| 93 | ) -> None: |
| 94 | """Test that ``create_git_command`` builds the correct command list based on inputs.""" |
| 95 | cmd = create_git_command(base_cmd, local_path, url, token) |
| 96 | |
| 97 | # The command should start with base_cmd and the -C option |
| 98 | expected_prefix = [*base_cmd, "-C", local_path] |
| 99 | assert cmd[: len(expected_prefix)] == expected_prefix |
| 100 | |
| 101 | # The suffix (anything after prefix) should match expected |
| 102 | assert cmd[len(expected_prefix) :] == expected_suffix |
| 103 | |
| 104 | |
| 105 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected