168 lines
3.7 KiB
JSON
168 lines
3.7 KiB
JSON
{
|
|
"description": "Test `format=templatefile` (with `_eid`) output via `Special:Ask`",
|
|
"setup": [
|
|
{
|
|
"namespace": "SMW_NS_PROPERTY",
|
|
"page": "Has GND",
|
|
"contents": "[[Has type::External identifier]] [[External formatter uri::http://d-nb.info/gnd/$1]]"
|
|
},
|
|
{
|
|
"namespace": "SMW_NS_PROPERTY",
|
|
"page": "Has name",
|
|
"contents": "[[Has type::Text]]"
|
|
},
|
|
{
|
|
"namespace": "NS_TEMPLATE",
|
|
"page": "BEACON (named)",
|
|
"contents": {
|
|
"import-from": "/../Fixtures/special-ask-0011-beacon-named-template-args.txt"
|
|
}
|
|
},
|
|
{
|
|
"namespace": "NS_TEMPLATE",
|
|
"page": "BEACON (numeric)",
|
|
"contents": {
|
|
"import-from": "/../Fixtures/special-ask-0011-beacon-numeric-template-args.txt"
|
|
}
|
|
},
|
|
{
|
|
"namespace": "NS_TEMPLATE",
|
|
"page": "BEACON-INTRO",
|
|
"contents": {
|
|
"import-from": "/../Fixtures/special-ask-0011-beacon-intro.txt"
|
|
}
|
|
},
|
|
{
|
|
"page": "Example/SA0011/1",
|
|
"contents": "[[Has name::John Doe]] [[Has GND::123456789]]"
|
|
},
|
|
{
|
|
"page": "Example/SA0011/2",
|
|
"contents": "[[Has name::Jane Doe]] [[Has GND::987654321]]"
|
|
}
|
|
],
|
|
"tests": [
|
|
{
|
|
"type": "special",
|
|
"about": "#0a (named args)",
|
|
"special-page": {
|
|
"page": "Ask",
|
|
"request-parameters": {
|
|
"p": {
|
|
"link": "none",
|
|
"limit": "10",
|
|
"offset": "0",
|
|
"mainlabel": "",
|
|
"named args": true,
|
|
"format": "templatefile",
|
|
"template": "BEACON (named)",
|
|
"introtemplate": "BEACON-INTRO"
|
|
},
|
|
"q": "[[Has GND::123456789]]",
|
|
"po": "?Has GND=GND|?Has name=Name"
|
|
}
|
|
},
|
|
"assert-output": {
|
|
"to-contain": {
|
|
"contents-file" : "/../Fixtures/res.special-ask-0011.0.txt"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "special",
|
|
"about": "#0b (namedargs)",
|
|
"special-page": {
|
|
"page": "Ask",
|
|
"request-parameters": {
|
|
"p": {
|
|
"link": "none",
|
|
"limit": "10",
|
|
"offset": "0",
|
|
"mainlabel": "",
|
|
"namedargs": true,
|
|
"format": "templatefile",
|
|
"template": "BEACON (named)",
|
|
"introtemplate": "BEACON-INTRO"
|
|
},
|
|
"q": "[[Has GND::123456789]]",
|
|
"po": "?Has GND=GND|?Has name=Name"
|
|
}
|
|
},
|
|
"assert-output": {
|
|
"to-contain": {
|
|
"contents-file" : "/../Fixtures/res.special-ask-0011.0.txt"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "special",
|
|
"about": "#1 (named template args, multiple rows)",
|
|
"special-page": {
|
|
"page": "Ask",
|
|
"request-parameters": {
|
|
"p": {
|
|
"link": "none",
|
|
"limit": "10",
|
|
"offset": "0",
|
|
"mainlabel": "",
|
|
"named args": true,
|
|
"format": "templatefile",
|
|
"template": "BEACON (named)",
|
|
"introtemplate": "BEACON-INTRO"
|
|
},
|
|
"q": "[[Has GND::123456789]] OR [[Has GND::987654321]]",
|
|
"po": "?Has GND=GND|?Has name=Name"
|
|
}
|
|
},
|
|
"assert-output": {
|
|
"to-contain": {
|
|
"contents-file" : "/../Fixtures/res.special-ask-0011.1.txt"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "special",
|
|
"about": "#2 (numeric template args, multiple rows)",
|
|
"special-page": {
|
|
"page": "Ask",
|
|
"request-parameters": {
|
|
"p": {
|
|
"link": "none",
|
|
"limit": "10",
|
|
"offset": "0",
|
|
"mainlabel": "",
|
|
"named args": false,
|
|
"format": "templatefile",
|
|
"template": "BEACON (numeric)",
|
|
"introtemplate": "BEACON-INTRO"
|
|
},
|
|
"q": "[[Has GND::123456789]] OR [[Has GND::987654321]]",
|
|
"po": "?Has GND=GND|?Has name=Name"
|
|
}
|
|
},
|
|
"assert-output": {
|
|
"to-contain": {
|
|
"contents-file" : "/../Fixtures/res.special-ask-0011.2.txt"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"settings": {
|
|
"wgContLang": "en",
|
|
"wgLang": "en",
|
|
"wgLanguageCode": "en",
|
|
"smwgPageSpecialProperties": [
|
|
"_MDAT"
|
|
],
|
|
"smwgNamespacesWithSemanticLinks": {
|
|
"NS_MAIN": true,
|
|
"SMW_NS_PROPERTY": true
|
|
}
|
|
},
|
|
"meta": {
|
|
"version": "2",
|
|
"is-incomplete": false,
|
|
"debug": false
|
|
}
|
|
}
|