mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-23 16:06:53 +00:00
Add another test case for transclusions overlapping comments
Prior to 8de940b5
, the comments on this page would not be marked as
partially transcluded.
Bug: T298408
Change-Id: Ib7eb8b4113151048c0e778b3530600d98dd8f705
This commit is contained in:
parent
428de4a658
commit
4e4e9f1c80
|
@ -284,6 +284,8 @@
|
|||
"data/plwiki-data.json",
|
||||
"data/srwiki-config.json",
|
||||
"data/srwiki-data.json",
|
||||
"data/commonswiki-config.json",
|
||||
"data/commonswiki-data.json",
|
||||
"cases/authors.json",
|
||||
"cases/comments.json",
|
||||
"cases/modified.json",
|
||||
|
|
|
@ -65,5 +65,8 @@ https://en.wikipedia.org/api/rest_v1/page/html/User_talk%3ADylsss/1058459889
|
|||
transclusions4:
|
||||
https://it.wikipedia.org/api/rest_v1/page/html/Wikipedia%3AVandalismi_in_corso/124462482
|
||||
|
||||
transclusions5:
|
||||
https://commons.wikimedia.org/api/rest_v1/page/html/Commons_talk%3ASPARQL_query_service
|
||||
|
||||
Text is available under the Creative Commons Attribution-ShareAlike License.
|
||||
See these pages for attribution.
|
||||
|
|
|
@ -31,6 +31,14 @@
|
|||
"config": "../data/itwiki-config.json",
|
||||
"data": "../data/itwiki-data.json"
|
||||
},
|
||||
{
|
||||
"name": "transclusions - comment partially template-generated 3",
|
||||
"title": "Commons talk:SPARQL query service",
|
||||
"dom": "cases/transclusions5/transclusions5.html",
|
||||
"expected": "../cases/transclusions5/transclusions5-transcludedFrom.json",
|
||||
"config": "../data/commonswiki-config.json",
|
||||
"data": "../data/commonswiki-data.json"
|
||||
},
|
||||
{
|
||||
"name": "enwiki parsoid",
|
||||
"title": "Wikipedia:Village pump (technical)/Archive 175",
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"c-FrankieRayRobertson-2020-12-21T13:38:00.000Z-How_to_authenticate_to_Wikimedia_Commons_Query_Service_using_OAuth_in_Python?": false,
|
||||
"c-Zache-2021-01-04T06:55:00.000Z-FrankieRayRobertson-2020-12-21T13:38:00.000Z": false,
|
||||
"c-Multichill-2021-02-13T18:31:00.000Z-Zache-2021-01-04T06:55:00.000Z": false,
|
||||
"c-Marsupium-2021-12-28T00:30:00.000Z-HTTP_500,_server_down?": false,
|
||||
"c-Shisma-2021-12-31T11:48:00.000Z-Marsupium-2021-12-28T00:30:00.000Z": true,
|
||||
"c-Marsupium-2021-12-31T12:19:00.000Z-Marsupium-2021-12-28T00:30:00.000Z": true
|
||||
}
|
16
tests/cases/transclusions5/transclusions5.html
Normal file
16
tests/cases/transclusions5/transclusions5.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html prefix="dc: http://purl.org/dc/terms/ mw: http://mediawiki.org/rdf/" about="https://commons.wikimedia.org/wiki/Special:Redirect/revision/617912464"><head prefix="mwr: https://commons.wikimedia.org/wiki/Special:Redirect/"><meta property="mw:TimeUuid" content="2924bd40-6a34-11ec-9e37-0fd12cc87fb8"/><meta charset="utf-8"/><meta property="mw:pageId" content="97909406"/><meta property="mw:pageNamespace" content="5"/><link rel="dc:replaces" resource="mwr:revision/617911980"/><meta property="mw:revisionSHA1" content="4c261fe5a23a510317febaf9bb17a55075503de3"/><meta property="dc:modified" content="2021-12-31T12:21:19.000Z"/><meta property="mw:htmlVersion" content="2.4.0"/><meta property="mw:html:version" content="2.4.0"/><link rel="dc:isVersionOf" href="//commons.wikimedia.org/wiki/Commons_talk%3ASPARQL_query_service"/><title>Commons talk:SPARQL query service</title><base href="//commons.wikimedia.org/wiki/"/><meta property="mw:styleModules" content="ext.discussionTools.init.styles"/><link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.discussionTools.init.styles%7Cmediawiki.skinning.content.parsoid%7Cmediawiki.skinning.interface%7Csite.styles&only=styles&skin=vector"/><meta http-equiv="content-language" content="en"/><meta http-equiv="vary" content="Accept"/></head><body id="mwAA" lang="en" class="mw-content-ltr sitedir-ltr ltr mw-body-content parsoid-body mediawiki mw-parser-output" dir="ltr"><section data-mw-section-id="0" id="mwAQ"></section><section data-mw-section-id="1" id="mwAg"><h2 id="How_to_authenticate_to_Wikimedia_Commons_Query_Service_using_OAuth_in_Python?"><span id="How_to_authenticate_to_Wikimedia_Commons_Query_Service_using_OAuth_in_Python.3F" typeof="mw:FallbackId"></span>How to authenticate to Wikimedia Commons Query Service using OAuth in Python?</h2>
|
||||
|
||||
<p id="mwAw">This page says it's possible to authenticate against the query service using OAuth, but has anyone managed to do so programmatically from Python? If anyone has any working code, in any language, I would appreciate whatever you can share. I've asked the full question including my not-working Python code on StackOverflow: <a rel="mw:ExtLink" href="https://stackoverflow.com/questions/65303450/how-to-authenticate-to-wikimedia-commons-query-service-using-oauth-in-python" class="external free" id="mwBA">https://stackoverflow.com/questions/65303450/how-to-authenticate-to-wikimedia-commons-query-service-using-oauth-in-python</a> --<a rel="mw:WikiLink" href="./User:FrankieRayRobertson" title="User:FrankieRayRobertson" class="new" id="mwBQ">FrankieRayRobertson</a> (<a rel="mw:WikiLink" href="./User_talk:FrankieRayRobertson" title="User talk:FrankieRayRobertson" id="mwBg"><span class="signature-talk" id="mwBw"><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"int:Talkpagelinktext","function":"int"},"params":{},"i":0}}]}' id="mwCA">talk</span></span></a>) 13:38, 21 December 2020 (UTC)</p>
|
||||
<dl id="mwCQ"><dd id="mwCg"><span class="template-ping" about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"ping","href":"./Template:Ping"},"params":{"1":{"wt":"Multichill"}},"i":0}}]}' id="mwCw">@<a rel="mw:WikiLink" href="./User:Multichill" title="User:Multichill">Multichill</a>: </span> do you have example code for this / are you using WCQS with python? --<a rel="mw:WikiLink" href="./User:Zache" title="User:Zache" id="mwDA">Zache</a> (<a rel="mw:WikiLink" href="./User_talk:Zache" title="User talk:Zache" id="mwDQ"><span class="signature-talk" id="mwDg"><span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"int:Talkpagelinktext","function":"int"},"params":{},"i":0}}]}' id="mwDw">talk</span></span></a>) 06:55, 4 January 2021 (UTC)
|
||||
<dl id="mwEA"><dd id="mwEQ"><span class="template-ping" about="#mwt4" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Ping","href":"./Template:Ping"},"params":{"1":{"wt":"Zache"}},"i":0}}]}' id="mwEg">@<a rel="mw:WikiLink" href="./User:Zache" title="User:Zache">Zache</a>: </span> no, would have to look into this. Should be part of Pywikibot if someone figures it out. Did you already file a task in phabricator to add support for <a rel="mw:ExtLink" href="https://wcqs-beta.wmflabs.org/" class="external free" id="mwEw">https://wcqs-beta.wmflabs.org/</a><span typeof="mw:DisplaySpace" id="mwFA"> </span>? <a rel="mw:WikiLink" href="./User:Multichill" title="User:Multichill" id="mwFQ">Multichill</a> (<a rel="mw:WikiLink" href="./User_talk:Multichill" title="User talk:Multichill" id="mwFg">talk</a>) 18:31, 13 February 2021 (UTC)</dd></dl></dd></dl>
|
||||
|
||||
</section><section data-mw-section-id="2" id="mwFw"><h2 id="HTTP_500,_server_down?"><span id="HTTP_500.2C_server_down.3F" typeof="mw:FallbackId"></span>HTTP 500, server down?</h2>
|
||||
|
||||
<p id="mwGA">For me <code id="mwGQ"><a rel="mw:ExtLink" href="https://wcqs-beta.wmflabs.org/" class="external free" id="mwGg">https://wcqs-beta.wmflabs.org/</a></code> throws a 500 Internal Server Error:</p>
|
||||
<pre id="mwGw">Problem accessing /oauth/check_login. Reason:
|
||||
Request failed.</pre>
|
||||
<p id="mwHA">Is this known? Any information when the query service might be back? Thanks in advance for any information or linking to relevant other places! --<a rel="mw:WikiLink" href="./User:Marsupium" title="User:Marsupium" id="mwHQ">Marsupium</a> (<a rel="mw:WikiLink" href="./User_talk:Marsupium" title="User talk:Marsupium" id="mwHg"><span class="signature-talk" id="mwHw"><span about="#mwt5" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"int:Talkpagelinktext","function":"int"},"params":{},"i":0}}]}' id="mwIA">talk</span></span></a>) 00:30, 28 December 2021 (UTC)</p>
|
||||
|
||||
<dl id="mwIQ"><dd id="mwIg"><span class="template-ping" about="#mwt6" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"re","href":"./Template:Re"},"params":{"1":{"wt":"Marsupium"}},"i":0}}]}' id="mwIw">@<a rel="mw:WikiLink" href="./User:Marsupium" title="User:Marsupium">Marsupium</a>: </span> issue was reported in T297454--<a rel="mw:WikiLink" href="./User:Shisma" title="User:Shisma" id="mwJA">Shisma</a> (<a rel="mw:WikiLink" href="./User_talk:Shisma" title="User talk:Shisma" id="mwJQ"><span class="signature-talk" id="mwJg"><span about="#mwt10" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"int:Talkpagelinktext","function":"int"},"params":{},"i":0}}]}' id="mwJw">talk</span></span></a>) 11:48, 31 December 2021 (UTC) <style data-mw-deduplicate="TemplateStyles:r578707000" typeof="mw:Extension/templatestyles mw:Transclusion" about="#mwt7" data-mw='{"parts":[{"template":{"target":{"wt":"phabricator","href":"./Template:Phabricator"},"params":{"1":{"wt":"T297454"}},"i":0}}]}' id="mwKA">.mw-parser-output .tracked{float:right;clear:right;border:1px solid #999;border-radius:0.5em;background-color:#eee;background-image:linear-gradient(to bottom,#ddd,#eee);font-size:85%;text-align:center;padding:0.5em;margin-left:1em;margin-bottom:1em;width:12em;color:black}.mw-parser-output .tracked p{margin:0}.mw-parser-output .tracked-url{font-weight:bold}.mw-parser-output .tracked .status,.mw-parser-output .tracked-status{font-weight:bold;text-transform:uppercase}.mw-parser-output .tracked .status.resolved,.mw-parser-output .tracked-resolved{color:green}.mw-parser-output .tracked .status.critical,.mw-parser-output .tracked-critical{color:red;font-size:1.5em}</style><div class="tracked plainlinks mw-trackedTemplate" about="#mwt7" id="mwKQ">Tracked in <a rel="mw:WikiLink/Interwiki" href="https://www.mediawiki.org/wiki/Special:MyLanguage/Phabricator" title="mw:Special:MyLanguage/Phabricator" class="extiw">Phabricator</a><br/><b><a rel="mw:WikiLink/Interwiki" href="https://phabricator.wikimedia.org/T297454" title="phabricator:T297454" class="extiw"><span class="tracked-url trakfab-T297454">Task T297454</span></a></b><br/><span class="status"></span></div>
|
||||
<dl id="mwKg"><dd id="mwKw">Thanks for the link! --<a rel="mw:WikiLink" href="./User:Marsupium" title="User:Marsupium" id="mwLA">Marsupium</a> (<a rel="mw:WikiLink" href="./User_talk:Marsupium" title="User talk:Marsupium" id="mwLQ"><span class="signature-talk" id="mwLg"><span about="#mwt11" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"int:Talkpagelinktext","function":"int"},"params":{},"i":0}}]}' id="mwLw">talk</span></span></a>) 12:19, 31 December 2021 (UTC)</dd></dl></dd></dl></section></body></html>
|
|
@ -4,7 +4,7 @@ required for us to be able to parse HTML generated by the given wiki.
|
|||
To make one of these files, run the following in browser console:
|
||||
|
||||
config.json:
|
||||
JSON.stringify( mw.config.get( [ 'wgContentLanguage', 'wgArticlePath', 'wgNamespaceIds', 'wgFormattedNamespaces' ] ), null, 2 )
|
||||
JSON.stringify( mw.config.get( [ 'wgContentLanguage', 'wgArticlePath', 'wgNamespaceIds', 'wgFormattedNamespaces' ] ), null, '\t' )
|
||||
|
||||
data.json:
|
||||
JSON.stringify( mw.loader.moduleRegistry[ 'ext.discussionTools.init' ].packageExports[ 'parser/data.json' ], null, 2 )
|
||||
JSON.stringify( mw.loader.moduleRegistry[ 'ext.discussionTools.init' ].packageExports[ 'parser/data.json' ], null, '\t' )
|
||||
|
|
98
tests/data/commonswiki-config.json
Normal file
98
tests/data/commonswiki-config.json
Normal file
|
@ -0,0 +1,98 @@
|
|||
{
|
||||
"wgContentLanguage": "en",
|
||||
"wgArticlePath": "/wiki/$1",
|
||||
"wgNamespaceIds": {
|
||||
"media": -2,
|
||||
"special": -1,
|
||||
"": 0,
|
||||
"talk": 1,
|
||||
"user": 2,
|
||||
"user_talk": 3,
|
||||
"commons": 4,
|
||||
"commons_talk": 5,
|
||||
"file": 6,
|
||||
"file_talk": 7,
|
||||
"mediawiki": 8,
|
||||
"mediawiki_talk": 9,
|
||||
"template": 10,
|
||||
"template_talk": 11,
|
||||
"help": 12,
|
||||
"help_talk": 13,
|
||||
"category": 14,
|
||||
"category_talk": 15,
|
||||
"creator": 100,
|
||||
"creator_talk": 101,
|
||||
"timedtext": 102,
|
||||
"timedtext_talk": 103,
|
||||
"sequence": 104,
|
||||
"sequence_talk": 105,
|
||||
"institution": 106,
|
||||
"institution_talk": 107,
|
||||
"campaign": 460,
|
||||
"campaign_talk": 461,
|
||||
"data": 486,
|
||||
"data_talk": 487,
|
||||
"gwtoolset": 490,
|
||||
"gwtoolset_talk": 491,
|
||||
"module": 828,
|
||||
"module_talk": 829,
|
||||
"translations": 1198,
|
||||
"translations_talk": 1199,
|
||||
"gadget": 2300,
|
||||
"gadget_talk": 2301,
|
||||
"gadget_definition": 2302,
|
||||
"gadget_definition_talk": 2303,
|
||||
"topic": 2600,
|
||||
"museum": 106,
|
||||
"museum_talk": 107,
|
||||
"com": 4,
|
||||
"cat": 14,
|
||||
"image": 6,
|
||||
"image_talk": 7,
|
||||
"project": 4,
|
||||
"project_talk": 5
|
||||
},
|
||||
"wgFormattedNamespaces": {
|
||||
"0": "",
|
||||
"1": "Talk",
|
||||
"2": "User",
|
||||
"3": "User talk",
|
||||
"4": "Commons",
|
||||
"5": "Commons talk",
|
||||
"6": "File",
|
||||
"7": "File talk",
|
||||
"8": "MediaWiki",
|
||||
"9": "MediaWiki talk",
|
||||
"10": "Template",
|
||||
"11": "Template talk",
|
||||
"12": "Help",
|
||||
"13": "Help talk",
|
||||
"14": "Category",
|
||||
"15": "Category talk",
|
||||
"100": "Creator",
|
||||
"101": "Creator talk",
|
||||
"102": "TimedText",
|
||||
"103": "TimedText talk",
|
||||
"104": "Sequence",
|
||||
"105": "Sequence talk",
|
||||
"106": "Institution",
|
||||
"107": "Institution talk",
|
||||
"460": "Campaign",
|
||||
"461": "Campaign talk",
|
||||
"486": "Data",
|
||||
"487": "Data talk",
|
||||
"490": "GWToolset",
|
||||
"491": "GWToolset talk",
|
||||
"828": "Module",
|
||||
"829": "Module talk",
|
||||
"1198": "Translations",
|
||||
"1199": "Translations talk",
|
||||
"2300": "Gadget",
|
||||
"2301": "Gadget talk",
|
||||
"2302": "Gadget definition",
|
||||
"2303": "Gadget definition talk",
|
||||
"2600": "Topic",
|
||||
"-2": "Media",
|
||||
"-1": "Special"
|
||||
}
|
||||
}
|
82
tests/data/commonswiki-data.json
Normal file
82
tests/data/commonswiki-data.json
Normal file
|
@ -0,0 +1,82 @@
|
|||
{
|
||||
"dateFormat": {
|
||||
"en": "H:i, j F Y"
|
||||
},
|
||||
"digits": {
|
||||
"en": [
|
||||
"0",
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9"
|
||||
]
|
||||
},
|
||||
"localTimezone": "UTC",
|
||||
"specialContributionsName": "Contributions",
|
||||
"specialNewSectionName": "NewSection",
|
||||
"timezones": {
|
||||
"en": {
|
||||
"UTC": "UTC"
|
||||
}
|
||||
},
|
||||
"contLangMessages": {
|
||||
"en": {
|
||||
"sunday": "Sunday",
|
||||
"monday": "Monday",
|
||||
"tuesday": "Tuesday",
|
||||
"wednesday": "Wednesday",
|
||||
"thursday": "Thursday",
|
||||
"friday": "Friday",
|
||||
"saturday": "Saturday",
|
||||
"sun": "Sun",
|
||||
"mon": "Mon",
|
||||
"tue": "Tue",
|
||||
"wed": "Wed",
|
||||
"thu": "Thu",
|
||||
"fri": "Fri",
|
||||
"sat": "Sat",
|
||||
"january": "January",
|
||||
"february": "February",
|
||||
"march": "March",
|
||||
"april": "April",
|
||||
"may_long": "May",
|
||||
"june": "June",
|
||||
"july": "July",
|
||||
"august": "August",
|
||||
"september": "September",
|
||||
"october": "October",
|
||||
"november": "November",
|
||||
"december": "December",
|
||||
"january-gen": "January",
|
||||
"february-gen": "February",
|
||||
"march-gen": "March",
|
||||
"april-gen": "April",
|
||||
"may-gen": "May",
|
||||
"june-gen": "June",
|
||||
"july-gen": "July",
|
||||
"august-gen": "August",
|
||||
"september-gen": "September",
|
||||
"october-gen": "October",
|
||||
"november-gen": "November",
|
||||
"december-gen": "December",
|
||||
"jan": "Jan",
|
||||
"feb": "Feb",
|
||||
"mar": "Mar",
|
||||
"apr": "Apr",
|
||||
"may": "May",
|
||||
"jun": "Jun",
|
||||
"jul": "Jul",
|
||||
"aug": "Aug",
|
||||
"sep": "Sep",
|
||||
"oct": "Oct",
|
||||
"nov": "Nov",
|
||||
"dec": "Dec"
|
||||
}
|
||||
},
|
||||
"signatureScanLimit": 100
|
||||
}
|
Loading…
Reference in a new issue