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)
| 78 | |
| 79 | @pytest.mark.asyncio |
| 80 | async 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 |
nothing calls this directly
no test coverage detected