feat: Add --all flag to estimate command to list available configs
- Added find_configs_directory() to use same logic as API (api/configs_repo/official first, then configs/) - Added list_all_configs() to display all 24 configs grouped by category with descriptions - Updated CLI to support --all flag, making config argument optional when --all is used - Added 2 new tests for --all flag functionality - All 51 tests passing (51 passed, 1 skipped) This enables users to discover all available preset configs without checking the API or filesystem directly. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -134,6 +134,60 @@ class TestEstimatePagesCLI(unittest.TestCase):
|
||||
except FileNotFoundError:
|
||||
self.skipTest("skill-seekers command not installed")
|
||||
|
||||
def test_cli_all_flag_lists_configs(self):
|
||||
"""Test that --all flag lists all available configs"""
|
||||
import subprocess
|
||||
|
||||
try:
|
||||
# Run with --all flag
|
||||
result = subprocess.run(
|
||||
['skill-seekers', 'estimate', '--all'],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=10
|
||||
)
|
||||
|
||||
# Should succeed
|
||||
self.assertEqual(result.returncode, 0)
|
||||
|
||||
# Should contain expected output
|
||||
output = result.stdout
|
||||
self.assertIn('AVAILABLE CONFIGS', output)
|
||||
self.assertIn('Total:', output)
|
||||
self.assertIn('configs found', output)
|
||||
|
||||
# Should list some known configs
|
||||
# (these should exist in api/configs_repo/official/)
|
||||
self.assertTrue(
|
||||
'react' in output.lower() or
|
||||
'django' in output.lower() or
|
||||
'godot' in output.lower(),
|
||||
"Expected at least one known config name in output"
|
||||
)
|
||||
except FileNotFoundError:
|
||||
self.skipTest("skill-seekers command not installed")
|
||||
|
||||
def test_cli_all_flag_with_direct_entry_point(self):
|
||||
"""Test --all flag works with skill-seekers-estimate entry point"""
|
||||
import subprocess
|
||||
|
||||
try:
|
||||
result = subprocess.run(
|
||||
['skill-seekers-estimate', '--all'],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=10
|
||||
)
|
||||
|
||||
# Should succeed
|
||||
self.assertEqual(result.returncode, 0)
|
||||
|
||||
# Should show available configs
|
||||
output = result.stdout
|
||||
self.assertIn('AVAILABLE CONFIGS', output)
|
||||
except FileNotFoundError:
|
||||
self.skipTest("skill-seekers-estimate command not installed")
|
||||
|
||||
|
||||
class TestEstimatePagesWithRealConfig(unittest.TestCase):
|
||||
"""Test estimation with real config files (if available)"""
|
||||
|
||||
Reference in New Issue
Block a user