Files
wehub-resource-sync 2cab53bc94
Test Vector Database Adaptors / Test MCP Vector DB Tools (push) Has been cancelled
Tests / Code Quality (Ruff & Mypy) (push) Has been cancelled
Tests / Fast Unit Tests (parallel) (macos-latest, 3.11) (push) Has been cancelled
Tests / Fast Unit Tests (parallel) (macos-latest, 3.12) (push) Has been cancelled
Tests / Tests (push) Has been cancelled
Docker Publish / Build and Push Docker Images (map[description:Skill Seekers CLI - Convert documentation to AI skills dockerfile:Dockerfile name:skill-seekers]) (push) Has been cancelled
Docker Publish / Build and Push Docker Images (map[description:Skill Seekers MCP Server - 25 tools for AI assistants dockerfile:Dockerfile.mcp name:skill-seekers-mcp]) (push) Has been cancelled
Docker Publish / Test Docker Images (push) Has been cancelled
Tests / Fast Unit Tests (parallel) (ubuntu-latest, 3.10) (push) Has been cancelled
Tests / Fast Unit Tests (parallel) (ubuntu-latest, 3.11) (push) Has been cancelled
Tests / Fast Unit Tests (parallel) (ubuntu-latest, 3.12) (push) Has been cancelled
Tests / Serial / Integration / E2E Tests (push) Has been cancelled
Tests / MCP Server Tests (push) Has been cancelled
Test Vector Database Adaptors / Test chroma Adaptor (push) Has been cancelled
Test Vector Database Adaptors / Test faiss Adaptor (push) Has been cancelled
Test Vector Database Adaptors / Test qdrant Adaptor (push) Has been cancelled
Test Vector Database Adaptors / Test weaviate Adaptor (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:46:28 +08:00

30 lines
1.0 KiB
Python

#!/usr/bin/env python3
"""Unit tests for estimate's input guard.
`estimate` takes a config JSON file, but `create` accepts URLs — so users
naturally try `estimate <url>`. The error must explain that and point them at
the right command instead of the bare "Config file not found: <url>".
"""
import pytest
from skill_seekers.cli.estimate_pages import load_config
class TestEstimateUrlGuard:
def test_url_argument_gives_actionable_error(self, capsys):
with pytest.raises(SystemExit) as exc:
load_config("https://docs.example.com/")
assert exc.value.code != 0
out = capsys.readouterr().out.lower()
# Names that a config file is required and points at how to make one.
assert "config" in out
assert "create" in out
def test_missing_file_still_errors_cleanly(self, capsys):
with pytest.raises(SystemExit) as exc:
load_config("/nonexistent/path/to/config.json")
assert exc.value.code != 0
out = capsys.readouterr().out.lower()
assert "not found" in out