Test reverting changes in the repository.
(temp_repo)
| 345 | |
| 346 | |
| 347 | def 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 | |
| 370 | def test_revert_to_commit_with_frid(temp_repo): |
nothing calls this directly
no test coverage detected