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

Function test_clone_nonexistent_repository

tests/test_clone.py:80–99  ·  view source on GitHub ↗

Test cloning a nonexistent repository URL. Given an invalid or nonexistent URL: When ``clone_repo`` is called, Then a ValueError should be raised with an appropriate error message.

(repo_exists_true: AsyncMock)

Source from the content-addressed store, hash-verified

78
79@pytest.mark.asyncio
80async def test_clone_nonexistent_repository(repo_exists_true: AsyncMock) -> None:
81 """Test cloning a nonexistent repository URL.
82
83 Given an invalid or nonexistent URL:
84 When ``clone_repo`` is called,
85 Then a ValueError should be raised with an appropriate error message.
86 """
87 clone_config = CloneConfig(
88 url="https://github.com/user/nonexistent-repo",
89 local_path=LOCAL_REPO_PATH,
90 commit=None,
91 branch="main",
92 )
93 # Override the default fixture behaviour for this test
94 repo_exists_true.return_value = False
95
96 with pytest.raises(ValueError, match="Repository not found"):
97 await clone_repo(clone_config)
98
99 repo_exists_true.assert_any_call(clone_config.url, token=None)
100
101
102@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 2

CloneConfigClass · 0.90
clone_repoFunction · 0.90

Tested by

no test coverage detected