Skip to content

Commit 8ed1d0c

Browse files
feat: add test for DuckDuckGo search functionality with NVIDIA query
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <[email protected]>
1 parent a8e3e04 commit 8ed1d0c

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/test_cli.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,45 @@ def test_parse_nytimes_shell():
160160
assert len(output) > 1000, "Expected significant text content from NYTimes"
161161

162162

163+
@pytest.mark.api
164+
@pytest.mark.skipif(
165+
" -m api" not in " ".join(sys.argv),
166+
reason="Skip tests using external APIs by default, use '-m api' to run them.",
167+
)
168+
def test_ddg_search_nvidia():
169+
"""Test DuckDuckGo search functionality with NVIDIA query."""
170+
result = subprocess.run(
171+
[
172+
"python",
173+
"-m",
174+
"wdoc",
175+
"--task=query",
176+
"--path=How is NVidia doing this month?",
177+
"--query=How is NVidia doing this month?",
178+
"--filetype=ddg",
179+
"--ddg_max_result=3",
180+
"--model=testing/testing",
181+
],
182+
capture_output=True,
183+
text=True,
184+
check=False,
185+
timeout=120,
186+
)
187+
188+
output = result.stdout + result.stderr
189+
190+
# Check that we got some output and no major errors
191+
assert len(output) > 100, f"Expected substantial output from DDG search, got: {output}"
192+
193+
# Should contain the testing model's standard response
194+
assert (
195+
"Lorem ipsum dolor sit amet" in output
196+
), f"Output did not contain expected testing string: {output}"
197+
198+
# Should not contain error messages about DDG functionality
199+
assert "Error" not in output or "error" not in output.lower(), f"Unexpected error in DDG search: {output}"
200+
201+
163202
# The pipe query and summaries test are broken. I think the issue is deep within
164203
# pytest as it works fine in the shell. They are kept below for legacy documentation
165204
# @pytest.mark.basic

0 commit comments

Comments
 (0)