Skip to content

Commit

Permalink
confirmed that extlinks will insert trailing backslash for bare urls
Browse files Browse the repository at this point in the history
  • Loading branch information
fastily committed Jun 26, 2023
1 parent 6ea137c commit 41f3f38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions tests/test_mquery.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from datetime import datetime
from unittest import skip

from pwiki.mquery import MQuery
from pwiki.ns import NS
Expand Down Expand Up @@ -41,10 +40,9 @@ def test_duplicate_files(self):
expected = {"File:FastilyTest.svg": []}
self.assertDictEqual(expected, MQuery.duplicate_files(self.wiki, list(expected.keys()), False, True))

@skip("Regression on testwiki - https://phabricator.wikimedia.org/T337994") # TODO - revisit
def test_external_links(self):
m = MQuery.external_links(self.wiki, ["User:Fastily/Sandbox/ExternalLink", "User:Fastily/Sandbox", "User:Fastily/DoesNotExist789"])
self.assertCountEqual(["https://www.google.com", "https://www.facebook.com", "https://github.com"], m["User:Fastily/Sandbox/ExternalLink"])
self.assertCountEqual(["https://www.google.com/", "https://www.facebook.com/", "https://github.com/"], m["User:Fastily/Sandbox/ExternalLink"])
self.assertFalse(m["User:Fastily/Sandbox"])
self.assertFalse(m["User:Fastily/DoesNotExist789"])

Expand Down
5 changes: 2 additions & 3 deletions tests/test_wiki.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest import mock, skip, TestCase
from unittest import mock, TestCase

from pwiki.ns import NS

Expand Down Expand Up @@ -108,9 +108,8 @@ def test_duplicate_files(self):
def test_exists(self):
self.assertTrue(self.wiki.exists("Main Page"))

@skip("Regression on testwiki - https://phabricator.wikimedia.org/T337994") # TODO - revisit
def test_external_links(self):
self.assertCountEqual(["https://www.google.com", "https://www.facebook.com", "https://github.com"], self.wiki.external_links("User:Fastily/Sandbox/ExternalLink"))
self.assertCountEqual(["https://www.google.com/", "https://www.facebook.com/", "https://github.com/"], self.wiki.external_links("User:Fastily/Sandbox/ExternalLink"))

def test_file_usage(self):
self.assertCountEqual(["User:Fastily/Sandbox/ImageLinks", "User:Fastily/Sandbox/Page"], self.wiki.file_usage("File:FastilyTest.svg"))
Expand Down

0 comments on commit 41f3f38

Please sign in to comment.