Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport Test 7 #2971

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions backend/tests/unit/danswer/connectors/mediawiki/test_wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@

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)
Expand Down Expand Up @@ -80,6 +83,7 @@ def latest_revision(self) -> pywikibot.page.Revision:
)


@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)
Expand All @@ -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.

Expand Down Expand Up @@ -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")
Expand Down
Loading