tests: fix failing tests
This commit is contained in:
parent
ab6a0ef11c
commit
5288ab4ab4
2 changed files with 5 additions and 12 deletions
|
|
@ -148,12 +148,6 @@ class BeautifulSoupLoader(LoaderInterface):
|
||||||
"all": True,
|
"all": True,
|
||||||
"join_with": "\n\n",
|
"join_with": "\n\n",
|
||||||
},
|
},
|
||||||
# Spans with data (fallback for inline content)
|
|
||||||
"data_spans": {
|
|
||||||
"selector": "span[data-*]",
|
|
||||||
"all": True,
|
|
||||||
"join_with": " ",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async def load(
|
async def load(
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ async def test_beautiful_soup_loader_is_selected_loader_if_preferred_loader_prov
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_beautiful_soup_loader_raises_if_required_args_are_missing():
|
async def test_beautiful_soup_loader_works_with_and_without_arguments():
|
||||||
await cognee.prune.prune_data()
|
await cognee.prune.prune_data()
|
||||||
await cognee.prune.prune_system(metadata=True)
|
await cognee.prune.prune_system(metadata=True)
|
||||||
|
|
||||||
|
|
@ -203,11 +203,10 @@ async def test_beautiful_soup_loader_raises_if_required_args_are_missing():
|
||||||
bs_loader = BeautifulSoupLoader()
|
bs_loader = BeautifulSoupLoader()
|
||||||
loader_engine.register_loader(bs_loader)
|
loader_engine.register_loader(bs_loader)
|
||||||
preferred_loaders = {"beautiful_soup_loader": {}}
|
preferred_loaders = {"beautiful_soup_loader": {}}
|
||||||
with pytest.raises(ValueError):
|
await loader_engine.load_file(
|
||||||
await loader_engine.load_file(
|
file_path,
|
||||||
file_path,
|
preferred_loaders=preferred_loaders,
|
||||||
preferred_loaders=preferred_loaders,
|
)
|
||||||
)
|
|
||||||
extraction_rules = {
|
extraction_rules = {
|
||||||
"title": {"selector": "title"},
|
"title": {"selector": "title"},
|
||||||
"headings": {"selector": "h1, h2, h3", "all": True},
|
"headings": {"selector": "h1, h2, h3", "all": True},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue