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

Function assert_standard_calls

tests/test_clone.py:325–338  ·  view source on GitHub ↗

Assert that the standard clone sequence of git commands was called.

(mock: AsyncMock, cfg: CloneConfig, commit: str, *, partial_clone: bool = False)

Source from the content-addressed store, hash-verified

323
324
325def 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
341def assert_partial_clone_calls(mock: AsyncMock, cfg: CloneConfig, commit: str) -> None:

Calls

no outgoing calls

Tested by

no test coverage detected