Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions parallel_web_tools/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,8 +1170,8 @@ def build_search_v1_kwargs(
@click.option("--max-results", type=int, help="Maximum results (defaults to server-side default of 10)")
@click.option("--include-domains", multiple=True, help="Only search these domains (comma-separated or repeated)")
@click.option("--exclude-domains", multiple=True, help="Exclude these domains (comma-separated or repeated)")
@click.option("--after-date", help="Only results after this date (YYYY-MM-DD)")
@click.option("--excerpt-max-chars-per-result", type=int, help="Max characters per result for excerpts (min 1000)")
@click.option("--after-date", help="Only results published on or after this date (YYYY-MM-DD)")
@click.option("--excerpt-max-chars-per-result", type=int, help="Max characters per result for excerpts")
@click.option(
"--excerpt-max-chars-total", type=int, default=60000, help="Max total characters for excerpts", show_default=True
)
Expand Down Expand Up @@ -1357,7 +1357,7 @@ def build_extract_v1_kwargs(
@click.option("--full-content", is_flag=True, help="Include complete page content")
@click.option("--full-content-max-chars", type=int, help="Max characters per result for full content")
@click.option("--no-excerpts", is_flag=True, help="Strip excerpts from output (V1 always returns them server-side)")
@click.option("--excerpt-max-chars-per-result", type=int, help="Max characters per result for excerpts (min 1000)")
@click.option("--excerpt-max-chars-per-result", type=int, help="Max characters per result for excerpts")
@click.option("--excerpt-max-chars-total", type=int, help="Max total characters for excerpts across all URLs")
@click.option("--max-age-seconds", type=int, help="Max age in seconds before fetching live content (min 600)")
@click.option("--timeout-seconds", type=float, help="Timeout in seconds for fetching live content")
Expand Down
20 changes: 20 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,19 @@ def test_search_help_prioritizes_native_modes(self, runner):
assert "--mode [turbo|fast|basic|advanced|one-shot|agentic]" in result.output
assert "Deprecated aliases" in result.output

def test_search_help_describes_after_date_as_inclusive(self, runner):
"""Should reflect the API's inclusive after_date behavior."""
result = runner.invoke(main, ["search", "--help"])
assert result.exit_code == 0
assert "published on or after" in result.output

def test_search_help_does_not_claim_excerpt_minimum(self, runner):
"""Search accepts excerpt sizes below the removed 1000-character minimum."""
result = runner.invoke(main, ["search", "--help"])
assert result.exit_code == 0
assert "--excerpt-max-chars-per-result" in result.output
assert "min 1000" not in result.output

def test_search_no_args(self, runner):
"""Should error without objective or query."""
result = runner.invoke(main, ["search"])
Expand All @@ -382,6 +395,13 @@ def test_extract_help(self, runner):
assert "Extract content" in result.output
assert "--json" in result.output

def test_extract_help_does_not_claim_excerpt_minimum(self, runner):
"""Extract accepts excerpt sizes below the removed 1000-character minimum."""
result = runner.invoke(main, ["extract", "--help"])
assert result.exit_code == 0
assert "--excerpt-max-chars-per-result" in result.output
assert "min 1000" not in result.output


class TestFetchCommand:
"""Tests for the fetch command (alias for extract)."""
Expand Down
Loading