Skip to content

[Cursor] Fix TestGitAutomation test failures#12

Merged
blopit merged 1 commit intomainfrom
fix-git-automation-tests
Feb 26, 2025
Merged

[Cursor] Fix TestGitAutomation test failures#12
blopit merged 1 commit intomainfrom
fix-git-automation-tests

Conversation

@blopit
Copy link
Owner

@blopit blopit commented Feb 26, 2025

[Cursor] Fix TestGitAutomation test failures

Issue

The TestGitAutomation class had failing tests due to improper mocking of temporary file operations, resulting in FileNotFoundError when attempting to delete non-existent temporary files.

Changes

  • Fixed test_commit_changes by adding proper mocking for os.unlink
  • Restructured test_create_pr to use patch decorators instead of context managers
  • Added explicit mock for get_branch_name in test_create_pr

Testing

All tests in test_git_automation.py now pass successfully.

Fixed test_commit_changes and test_create_pr methods in TestGitAutomation class by:
- Adding proper mocking for os.unlink to prevent FileNotFoundError
- Restructuring the test_create_pr method to use patch decorators instead of context managers
- Adding explicit mock for get_branch_name in test_create_pr
@blopit blopit merged commit cb0311f into main Feb 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant