MCPcopy
hub / github.com/coderamp-labs/gitingest / test_clone_branch_with_slashes

Function test_clone_branch_with_slashes

tests/test_clone.py:228–243  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

226
227@pytest.mark.asyncio
228async 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

Callers

nothing calls this directly

Calls 3

CloneConfigClass · 0.90
clone_repoFunction · 0.90
assert_standard_callsFunction · 0.85

Tested by

no test coverage detected