Skip to content

Commit

Permalink
fix: update test for auto configuration
Browse files Browse the repository at this point in the history
This change simplifies the test for auto-creating a configuration file by removing unnecessary output capturing, which is no longer needed for the assertion.
  • Loading branch information
versun committed Dec 28, 2024
1 parent 34496a1 commit 7b9ba4a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,12 @@ def test_no_args_without_repo(tmp_path):
assert str(exc_info.value) == "Not a valid Git repository"


def test_auto_create_config(capsys, mock_repo, mock_home_dir):
def test_auto_create_config(mock_repo, mock_home_dir):
"""Test no configuration file"""
config_file = mock_home_dir / ".config/aicmt/.aicmtrc"
assert not config_file.exists()
with patch.object(sys, "argv", ["aicmt"]):
AiCommit(mock_repo)
captured = capsys.readouterr()
assert "Please check and update your configuration file." in captured.out
assert config_file.exists()

def test_no_changes(ai_commit, mock_repo, mock_openai, mock_config):
Expand Down

0 comments on commit 7b9ba4a

Please sign in to comment.