mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-02 00:51:40 +02:00
Backport Test 7 (#2971)
This commit is contained in:
parent
e46facb765
commit
5062075b8d
@ -9,12 +9,15 @@ from pytest_mock import MockFixture
|
||||
|
||||
from danswer.connectors.mediawiki import wiki
|
||||
|
||||
# These tests are disabled for now
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def site() -> pywikibot.Site:
|
||||
return pywikibot.Site("en", "wikipedia")
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Test disabled")
|
||||
def test_pywikibot_timestamp_to_utc_datetime() -> None:
|
||||
timestamp_without_tzinfo = pywikibot.Timestamp(2023, 12, 27, 15, 38, 49)
|
||||
timestamp_min_timezone = timestamp_without_tzinfo.astimezone(datetime.timezone.min)
|
||||
@ -80,6 +83,7 @@ class MockPage(pywikibot.Page):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Test disabled")
|
||||
def test_get_doc_from_page(site: pywikibot.Site) -> None:
|
||||
test_page = MockPage(site, "Test Page", _has_categories=True)
|
||||
doc = wiki.get_doc_from_page(test_page, site, wiki.DocumentSource.MEDIAWIKI)
|
||||
@ -103,6 +107,7 @@ def test_get_doc_from_page(site: pywikibot.Site) -> None:
|
||||
assert doc.id == f"MEDIAWIKI_{test_page.pageid}_{test_page.full_url()}"
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Test disabled")
|
||||
def test_mediawiki_connector_recurse_depth() -> None:
|
||||
"""Test that the recurse_depth parameter is parsed correctly.
|
||||
|
||||
@ -132,6 +137,7 @@ def test_mediawiki_connector_recurse_depth() -> None:
|
||||
assert connector.recurse_depth == recurse_depth
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Test disabled")
|
||||
def test_load_from_state_calls_poll_source_with_nones(mocker: MockFixture) -> None:
|
||||
connector = wiki.MediaWikiConnector("wikipedia.org", [], [], 0, "test")
|
||||
poll_source = mocker.patch.object(connector, "poll_source")
|
||||
|
Loading…
x
Reference in New Issue
Block a user