fix: Resolve all 3 failing config CLI tests - complete test suite now passing

- Fix test_troubleshoot_config_failure: Add missing is_git_repository key to mock data
- Fix test_perform_validation_checks_invalid_gitea_url: Bypass constructor validation for testing invalid URLs
- Fix test_show_gitea_configuration: Mock filesystem operations to prevent real config interference
- Rename tests for better clarity in TDDAI/Gitea context
- Update NEXT.md: All 348 tests now passing, ready for next development phase

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-29 09:23:23 +02:00
parent 933d8ece5b
commit 0694d16876
2 changed files with 35 additions and 31 deletions

View File

@@ -172,7 +172,7 @@ class TestConfigCommands:
},
'filesystem': {},
'config_files': {},
'git_repository': {}
'git_repository': {'is_git_repository': False}
}
self.config_commands.troubleshoot_config()
@@ -241,14 +241,14 @@ class TestConfigCommands:
error_results = [r for r in results if r['status'] == 'error']
assert len(error_results) >= 2 # At least gitea_url and repo_owner
def test_perform_validation_checks_invalid_url(self):
"""Test validation checks with invalid URL format."""
config = MarkitectConfig(
gitea_url="invalid-url",
repo_owner="test_owner",
repo_name="test_repo",
workspace_dir=Path(".test_workspace")
)
def test_perform_validation_checks_invalid_gitea_url(self):
"""Test validation checks with invalid Gitea URL format."""
# Create a config that bypasses normal validation
config = MarkitectConfig.__new__(MarkitectConfig)
config.gitea_url = "invalid-url"
config.repo_owner = "test_owner"
config.repo_name = "test_repo"
config.workspace_dir = Path(".test_workspace")
results = self.config_commands._perform_validation_checks(config)
@@ -401,8 +401,13 @@ class TestConfigPresenter:
assert "❌ Test error message" in output
@patch('sys.stdout', new_callable=StringIO)
def test_show_configuration(self, mock_stdout):
"""Test configuration display."""
@patch('pathlib.Path.exists')
@patch('pathlib.Path.iterdir')
def test_show_gitea_configuration(self, mock_iterdir, mock_exists, mock_stdout):
"""Test Gitea configuration display."""
mock_exists.return_value = False # Don't check real filesystem
mock_iterdir.return_value = []
config = MarkitectConfig(
gitea_url="https://github.com",
repo_owner="test_owner",