MCPcopy
hub / github.com/langroid/langroid / test_git_commit_mods

Function test_git_commit_mods

tests/main/test_git_utils.py:80–94  ·  view source on GitHub ↗
(temp_git_repo)

Source from the content-addressed store, hash-verified

78
79
80def test_git_commit_mods(temp_git_repo):
81 test_file = os.path.join(temp_git_repo.working_dir, "test.txt")
82 with open(test_file, "w") as f:
83 f.write("Test content")
84
85 # Add the file to the git index
86 temp_git_repo.index.add([test_file])
87
88 git_commit_mods(temp_git_repo)
89
90 assert "test.txt" in temp_git_repo.git.ls_files().split()
91
92 # Check if the file was actually committed
93 assert len(temp_git_repo.head.commit.tree.blobs) > 0
94 assert any(blob.name == "test.txt" for blob in temp_git_repo.head.commit.tree.blobs)
95
96
97def test_git_restore_repo(temp_git_repo):

Callers

nothing calls this directly

Calls 4

git_commit_modsFunction · 0.90
writeMethod · 0.80
addMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…