Test cloning a branch with slashes in the name. Given a valid repository URL and a branch name with slashes: When ``clone_repo`` is called, Then the repository should be cloned and checked out at that branch.
(tmp_path: Path, run_command_mock: AsyncMock)
| 226 | |
| 227 | @pytest.mark.asyncio |
| 228 | async def test_clone_branch_with_slashes(tmp_path: Path, run_command_mock: AsyncMock) -> None: |
| 229 | """Test cloning a branch with slashes in the name. |
| 230 | |
| 231 | Given a valid repository URL and a branch name with slashes: |
| 232 | When ``clone_repo`` is called, |
| 233 | Then the repository should be cloned and checked out at that branch. |
| 234 | """ |
| 235 | branch_name = "fix/in-operator" |
| 236 | local_path = tmp_path / "gitingest" |
| 237 | expected_call_count = GIT_INSTALLED_CALLS + 4 # ensure_git_installed + resolve_commit + clone + fetch + checkout |
| 238 | clone_config = CloneConfig(url=DEMO_URL, local_path=str(local_path), branch=branch_name) |
| 239 | |
| 240 | await clone_repo(clone_config) |
| 241 | |
| 242 | assert_standard_calls(run_command_mock, clone_config, commit=DEMO_COMMIT) |
| 243 | assert run_command_mock.call_count == expected_call_count |
| 244 | |
| 245 | |
| 246 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected