Module:Political party/testcases: Difference between revisions
Appearance
Content deleted Content added
No edit summary |
No edit summary |
||
Line 23: | Line 23: | ||
function p:test_03_invalid_types() |
function p:test_03_invalid_types() |
||
self:preprocess_equals_sandbox_many('{{#invoke:Political party', 'fetch', { |
self:preprocess_equals_sandbox_many('{{#invoke:Political party', 'fetch', { |
||
{'', 'parameter 1 should be a party name.'}, |
{'', '<strong class="error">parameter 1 should be a party name.</strong>'}, |
||
{'|color', 'parameter 1 should be a party name.'}, |
{'|color', '<strong class="error">parameter 1 should be a party name.</strong>'}, |
||
{'|shortname', 'parameter 1 should be a party name.'}, |
{'|shortname', '<strong class="error">parameter 1 should be a party name.</strong>'}, |
||
{'|abbrev', 'parameter 1 should be a party name.'}, |
{'|abbrev', '<strong class="error">parameter 1 should be a party name.</strong>'}, |
||
{'Business and Professional Group', 'parameter 2 should be the output type.'}, |
{'Business and Professional Group', '<strong class="error">parameter 2 should be the output type.</strong>'}, |
||
}, {nowiki=1}) |
}, {nowiki=1}) |
||
end |
end |
Revision as of 09:45, 26 November 2021
![]() | This is the test cases page for the module Module:Political party. Results of the test cases. |
-- Unit tests for [[Module:Political party]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_01_bad_values()
self:preprocess_equals_sandbox_many('{{#invoke:Political party', 'fetch', {
{'Aaaaaaaaaaa|color', '#F8F9FA'},
{'Aaaaaaaaaaa|shortname', 'Aaaaaaaaaaa'},
{'aontú|color', '#F8F9FA'},
}, {nowiki=1})
end
function p:test_02_fallback_values()
self:preprocess_equals_sandbox_many('{{#invoke:Political party', 'fetch', {
{'A test no values|color', '<strong class="error">Value not in template. Please request that it be added.</strong>'},
{'Aontú|shortname', 'Aon'},
{'[[Aontú]]|shortname', 'Aon'},
{'[[Aontú|Aontú2]]|shortname', 'Aon'},
{'Actual Equality|shortname', 'Actual Equality'},
{'Actual Equality|abbrev', 'Actual Equality'},
}, {nowiki=1})
end
function p:test_03_invalid_types()
self:preprocess_equals_sandbox_many('{{#invoke:Political party', 'fetch', {
{'', '<strong class="error">parameter 1 should be a party name.</strong>'},
{'|color', '<strong class="error">parameter 1 should be a party name.</strong>'},
{'|shortname', '<strong class="error">parameter 1 should be a party name.</strong>'},
{'|abbrev', '<strong class="error">parameter 1 should be a party name.</strong>'},
{'Business and Professional Group', '<strong class="error">parameter 2 should be the output type.</strong>'},
}, {nowiki=1})
end
return p