refactor tavily_crawler test
This commit is contained in:
parent
3f5c09eb45
commit
a35bcecdf9
1 changed files with 1 additions and 4 deletions
|
|
@ -1,14 +1,11 @@
|
||||||
import os
|
|
||||||
import pytest
|
import pytest
|
||||||
from cognee.tasks.web_scraper.config import TavilyConfig
|
|
||||||
from cognee.tasks.web_scraper.utils import fetch_with_tavily
|
from cognee.tasks.web_scraper.utils import fetch_with_tavily
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_fetch():
|
async def test_fetch():
|
||||||
url = "https://en.wikipedia.org/wiki/Large_language_model"
|
url = "https://en.wikipedia.org/wiki/Large_language_model"
|
||||||
tavily_config = TavilyConfig()
|
results = await fetch_with_tavily(url)
|
||||||
results = await fetch_with_tavily(url, tavily_config)
|
|
||||||
assert len(results) == 1
|
assert len(results) == 1
|
||||||
assert isinstance(results, dict)
|
assert isinstance(results, dict)
|
||||||
html = results[url]
|
html = results[url]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue