Skip to content

Commit 408afeb

Browse files
fix: formatting for test cases.
1 parent 6706742 commit 408afeb

File tree

3 files changed

+15
-34
lines changed

3 files changed

+15
-34
lines changed

tests/test_file_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"name": "upload_image_with_temp_url",
3333
"file": BINARY_FILE_CONTENT,
3434
"options": {
35-
"key": f"test_image.jpg",
35+
"key": "test_image.jpg",
3636
"content_type": "image/jpeg",
3737
"overwrite": True,
3838
"temp_public_url": True,

tests/test_image_generation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import logging
66
from dotenv import load_dotenv
77
import os
8-
import base64
98

109
load_dotenv()
1110
logging.basicConfig(level=logging.INFO)
@@ -166,7 +165,7 @@ def test_image_to_image_generation(self, test_case):
166165
assert result is not None
167166

168167
if type(result) is dict:
169-
assert result.get("success") == True
168+
assert result.get("success")
170169
assert result.get("url") is not None
171170
elif type(result) is bytes:
172171
assert isinstance(result, bytes)
@@ -217,7 +216,7 @@ async def test_image_to_image_generation_async(self, test_case):
217216

218217
assert result is not None
219218
if type(result) is dict:
220-
assert result.get("success") == True
219+
assert result.get("success")
221220
assert result.get("url") is not None
222221
elif type(result) is bytes:
223222
assert isinstance(result, bytes)

tests/test_web.py

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@
1010
logging.basicConfig(level=logging.INFO)
1111
logger = logging.getLogger(__name__)
1212

13-
jigsaw = jigsawstack.JigsawStack(
14-
api_url="http://localhost:3000/api/", api_key=os.getenv("JIGSAWSTACK_API_KEY")
15-
)
16-
async_jigsaw = jigsawstack.AsyncJigsawStack(
17-
api_url="http://localhost:3000/api/", api_key=os.getenv("JIGSAWSTACK_API_KEY")
18-
)
13+
jigsaw = jigsawstack.JigsawStack(api_key=os.getenv("JIGSAWSTACK_API_KEY"))
14+
async_jigsaw = jigsawstack.AsyncJigsawStack(api_key=os.getenv("JIGSAWSTACK_API_KEY"))
1915

2016
URL = "https://jigsawstack.com"
2117

@@ -40,6 +36,7 @@
4036
"name": "scrape_with_features",
4137
"params": {
4238
"url": URL,
39+
"element_prompts": ["title"],
4340
"features": ["meta", "link"],
4441
},
4542
},
@@ -51,14 +48,6 @@
5148
"root_element_selector": "main",
5249
},
5350
},
54-
{
55-
"name": "scrape_with_wait_for_selector",
56-
"params": {
57-
"url": URL,
58-
"element_prompts": ["dynamic content"],
59-
"wait_for": {"mode": "selector", "value": ".loaded-content"},
60-
},
61-
},
6251
{
6352
"name": "scrape_with_wait_for_timeout",
6453
"params": {
@@ -186,13 +175,6 @@
186175
"query": "artificial intelligence news",
187176
},
188177
},
189-
{
190-
"name": "search_with_max_results",
191-
"params": {
192-
"query": "python programming",
193-
"max_results": 5,
194-
},
195-
},
196178
{
197179
"name": "search_specific_site",
198180
"params": {
@@ -203,7 +185,7 @@
203185
"name": "search_ai_mode",
204186
"params": {
205187
"query": "explain quantum computing",
206-
"ai": True,
188+
"ai_overview": True,
207189
},
208190
},
209191
]
@@ -248,7 +230,7 @@
248230
"name": "deep_research_with_depth",
249231
"params": {
250232
"query": "renewable energy sources",
251-
"depth": 3,
233+
"depth": 2,
252234
},
253235
},
254236
]
@@ -381,9 +363,9 @@ def test_deep_research(self, test_case):
381363
result = jigsaw.web.deep_research(test_case["params"])
382364

383365
assert result["success"]
384-
assert "report" in result
385-
assert isinstance(result["report"], str)
386-
assert len(result["report"]) > 0
366+
assert "results" in result
367+
assert isinstance(result["results"], str)
368+
assert len(result["results"]) > 0
387369

388370
# Check for sources
389371
if "sources" in result:
@@ -483,7 +465,7 @@ async def test_search_async(self, test_case):
483465
assert "description" in item
484466

485467
# Check AI mode response
486-
if test_case["params"].get("ai"):
468+
if test_case["params"].get("ai_overview"):
487469
assert "ai_overview" in result
488470

489471
except JigsawStackError as e:
@@ -528,9 +510,9 @@ async def test_deep_research_async(self, test_case):
528510
result = await async_jigsaw.web.deep_research(test_case["params"])
529511

530512
assert result["success"]
531-
assert "report" in result
532-
assert isinstance(result["report"], str)
533-
assert len(result["report"]) > 0
513+
assert "results" in result
514+
assert isinstance(result["results"], str)
515+
assert len(result["results"]) > 0
534516

535517
# Check for sources
536518
if "sources" in result:

0 commit comments

Comments
 (0)