mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-29 11:12:02 +01:00
parent
60bd9271f7
commit
4aa8eb8b75
@ -4,6 +4,10 @@ from onyx.connectors.models import Document
|
||||
from onyx.connectors.web.connector import WEB_CONNECTOR_VALID_SETTINGS
|
||||
from onyx.connectors.web.connector import WebConnector
|
||||
|
||||
EXPECTED_QUOTE = (
|
||||
"If you can't explain it to a six year old, you don't understand it yourself."
|
||||
)
|
||||
|
||||
|
||||
# NOTE(rkuo): we will probably need to adjust this test to point at our own test site
|
||||
# to avoid depending on a third party site
|
||||
@ -11,7 +15,7 @@ from onyx.connectors.web.connector import WebConnector
|
||||
def web_connector(request: pytest.FixtureRequest) -> WebConnector:
|
||||
scroll_before_scraping = request.param
|
||||
connector = WebConnector(
|
||||
base_url="https://developer.onewelcome.com",
|
||||
base_url="https://quotes.toscrape.com/scroll",
|
||||
web_connector_type=WEB_CONNECTOR_VALID_SETTINGS.SINGLE.value,
|
||||
scroll_before_scraping=scroll_before_scraping,
|
||||
)
|
||||
@ -28,7 +32,7 @@ def test_web_connector_scroll(web_connector: WebConnector) -> None:
|
||||
|
||||
assert len(all_docs) == 1
|
||||
doc = all_docs[0]
|
||||
assert "Onegini Identity Cloud" in doc.sections[0].text
|
||||
assert EXPECTED_QUOTE in doc.sections[0].text
|
||||
|
||||
|
||||
@pytest.mark.parametrize("web_connector", [False], indirect=True)
|
||||
@ -41,4 +45,4 @@ def test_web_connector_no_scroll(web_connector: WebConnector) -> None:
|
||||
|
||||
assert len(all_docs) == 1
|
||||
doc = all_docs[0]
|
||||
assert "Onegini Identity Cloud" not in doc.sections[0].text
|
||||
assert EXPECTED_QUOTE not in doc.sections[0].text
|
||||
|
Loading…
x
Reference in New Issue
Block a user