MCPcopy Index your code
hub / github.com/Codeplain-ai/codeplain / test_revert_changes

Function test_revert_changes

tests/test_git_utils.py:347–367  ·  view source on GitHub ↗

Test reverting changes in the repository.

(temp_repo)

Source from the content-addressed store, hash-verified

345
346
347def test_revert_changes(temp_repo):
348 """Test reverting changes in the repository."""
349 # Create and commit initial file
350 file_path = Path(temp_repo) / "test.txt"
351 file_path.write_text("initial content")
352 repo = add_all_files_and_commit(temp_repo, "Initial commit", None, "FR123")
353
354 # Modify the file
355 file_path.write_text("modified content")
356
357 # Verify the file was modified
358 assert file_path.read_text() == "modified content"
359
360 # Revert changes
361 repo = revert_changes(temp_repo)
362
363 # Verify the file was reverted
364 assert file_path.read_text() == "initial content"
365
366 # Verify working directory is clean
367 assert not repo.is_dirty()
368
369
370def test_revert_to_commit_with_frid(temp_repo):

Callers

nothing calls this directly

Calls 2

add_all_files_and_commitFunction · 0.90
revert_changesFunction · 0.90

Tested by

no test coverage detected