Assert that the standard clone sequence of git commands was called.
(mock: AsyncMock, cfg: CloneConfig, commit: str, *, partial_clone: bool = False)
| 323 | |
| 324 | |
| 325 | def assert_standard_calls(mock: AsyncMock, cfg: CloneConfig, commit: str, *, partial_clone: bool = False) -> None: |
| 326 | """Assert that the standard clone sequence of git commands was called.""" |
| 327 | mock.assert_any_call("git", "--version") |
| 328 | if sys.platform == "win32": |
| 329 | mock.assert_any_call("git", "config", "core.longpaths") |
| 330 | |
| 331 | # Clone |
| 332 | clone_cmd = ["git", "clone", "--single-branch", "--no-checkout", "--depth=1"] |
| 333 | if partial_clone: |
| 334 | clone_cmd += ["--filter=blob:none", "--sparse"] |
| 335 | mock.assert_any_call(*clone_cmd, cfg.url, cfg.local_path) |
| 336 | |
| 337 | mock.assert_any_call("git", "-C", cfg.local_path, "fetch", "--depth=1", "origin", commit) |
| 338 | mock.assert_any_call("git", "-C", cfg.local_path, "checkout", commit) |
| 339 | |
| 340 | |
| 341 | def assert_partial_clone_calls(mock: AsyncMock, cfg: CloneConfig, commit: str) -> None: |
no outgoing calls
no test coverage detected