forked from moinwiki/moin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For converter tests, align input and expected output below each other…
… for clarity. Use single quotes unless single quotes are part of the string literals.
- Loading branch information
JanHoefelmeyer
committed
Apr 13, 2023
1 parent
e516641
commit a14ef02
Showing
8 changed files
with
409 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,12 +21,18 @@ def conv(): | |
@pytest.mark.parametrize( | ||
'input_,output', | ||
( | ||
('wiki:///Test', '/Test'), | ||
('wiki:///Test:colon', '/Test:colon'), | ||
('wiki:///Test?mode=raw', '/Test?mode=raw'), | ||
('wiki:///Test#anchor', '/Test#anchor'), | ||
('wiki:///Test?mode=raw#anchor', '/Test?mode=raw#anchor'), | ||
('wiki://MoinMoin/Test', 'http://moinmo.in/Test'), | ||
('wiki:///Test', | ||
'/Test'), | ||
('wiki:///Test:colon', | ||
'/Test:colon'), | ||
('wiki:///Test?mode=raw', | ||
'/Test?mode=raw'), | ||
('wiki:///Test#anchor', | ||
'/Test#anchor'), | ||
('wiki:///Test?mode=raw#anchor', | ||
'/Test?mode=raw#anchor'), | ||
('wiki://MoinMoin/Test', | ||
'http://moinmo.in/Test'), | ||
), | ||
) | ||
def test_wiki(app, conv, input_, output): | ||
|
@@ -41,18 +47,40 @@ def test_wiki(app, conv, input_, output): | |
'input_,page,output', | ||
( | ||
# note: result URLs assume test wiki running at / | ||
('wiki.local:', 'wiki:///Root', '/Root'), | ||
('wiki.local:Test', 'wiki:///Root', '/Test'), | ||
('wiki.local:Test:colon', 'wiki:///Root', '/Test:colon'), | ||
('wiki.local:users/Test:colon', 'wiki:///Root', '/users/Test:colon'), | ||
('wiki.local:users:ns/Test:colon', 'wiki:///Root', '/users:ns/Test:colon'), | ||
('wiki.local:Test', 'wiki:///Root/Sub', '/Test'), | ||
('wiki.local:/Test', 'wiki:///Root', '/Root/Test'), | ||
('wiki.local:/Test', 'wiki:///Root/Sub', '/Root/Sub/Test'), | ||
('wiki.local:../Test', 'wiki:///Root', '/Test'), | ||
('wiki.local:../Test', 'wiki:///Root/Sub', '/Root/Test'), | ||
('wiki.local:', | ||
'wiki:///Root', | ||
'/Root'), | ||
('wiki.local:Test', | ||
'wiki:///Root', | ||
'/Test'), | ||
('wiki.local:Test:colon', | ||
'wiki:///Root', | ||
'/Test:colon'), | ||
('wiki.local:users/Test:colon', | ||
'wiki:///Root', | ||
'/users/Test:colon'), | ||
('wiki.local:users:ns/Test:colon', | ||
'wiki:///Root', | ||
'/users:ns/Test:colon'), | ||
('wiki.local:Test', | ||
'wiki:///Root/Sub', | ||
'/Test'), | ||
('wiki.local:/Test', | ||
'wiki:///Root', | ||
'/Root/Test'), | ||
('wiki.local:/Test', | ||
'wiki:///Root/Sub', | ||
'/Root/Sub/Test'), | ||
('wiki.local:../Test', | ||
'wiki:///Root', | ||
'/Test'), | ||
('wiki.local:../Test', | ||
'wiki:///Root/Sub', | ||
'/Root/Test'), | ||
# this is a local wiki item with a name happening to have a ":' inside: | ||
('wiki.local:NoInterWiki:Item', 'wiki:///Root', '/NoInterWiki:Item'), | ||
('wiki.local:NoInterWiki:Item', | ||
'wiki:///Root', | ||
'/NoInterWiki:Item'), | ||
) | ||
) | ||
def test_wikilocal(conv, input_, page, output): | ||
|
@@ -64,8 +92,10 @@ def test_wikilocal(conv, input_, page, output): | |
@pytest.mark.parametrize( | ||
'input_,output', | ||
( | ||
('http://moinmo.in/', 'http://moinmo.in/'), | ||
('mailto:[email protected]', 'mailto:[email protected]'), | ||
('http://moinmo.in/', | ||
'http://moinmo.in/'), | ||
('mailto:[email protected]', | ||
'mailto:[email protected]'), | ||
) | ||
) | ||
def test_wikiexternal(conv, input_, output): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.