MCPcopy
hub / github.com/langroid/langroid / test_git_restore_file

Function test_git_restore_file

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

Source from the content-addressed store, hash-verified

105
106
107def test_git_restore_file(temp_git_repo):
108 test_file = os.path.join(temp_git_repo.working_dir, "test.txt")
109 with open(test_file, "w") as f:
110 f.write("Initial content")
111 git_commit_file(temp_git_repo, "test.txt", "Initial commit")
112
113 with open(test_file, "w") as f:
114 f.write("Modified content")
115
116 git_restore_file(temp_git_repo, "test.txt")
117
118 with open(test_file, "r") as f:
119 content = f.read()
120 assert content == "Initial content"
121
122
123def test_git_create_checkout_branch(temp_git_repo):

Callers

nothing calls this directly

Calls 3

git_commit_fileFunction · 0.90
git_restore_fileFunction · 0.90
writeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…