Module:YouTubeSubscribers/testcases
Appearance
| This is the test cases page for the module Module:YouTubeSubscribers. Results of the test cases. |
local p = require('Module:UnitTests')
function p:test_YT_subCount()
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCount|qid=Q111862397}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCount|qid=Q24088544}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCount|qid=Q5}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCount|qid=Q999999999999}}', '<strong class="error"><span class="scribunto-error mw-scribunto-error-5e455087">The ID "Q999999999999" is unknown to the system. Please use a valid entity ID.</span></strong>')
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCount|qid=Q4115189}}', '', {noexpectation=1})
end
function p:test_YT_subCountNice()
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q111862397}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q24088544}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q5}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q999999999999}}', '<strong class="error"><span class="scribunto-error mw-scribunto-error-5e455087">The ID "Q999999999999" is unknown to the system. Please use a valid entity ID.</span></strong>')
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q4115189}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q28549924}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q1385340}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers/sandbox|subCountNice|qid=Q28549924}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers/sandbox|subCountNice|qid=Q1385340}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q739105}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers/sandbox|subCountNice|qid=Q739105}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice}}', '', {noexpectation=1})
self:preprocess_equals('{{#invoke:YouTubeSubscribers/sandbox|subCountNice}}', '', {noexpectation=1})
end
function p:test_YT_date()
self:preprocess_equals('{{#invoke:YouTubeSubscribers|date|qid=Q111862397}}', 'October 2025')
self:preprocess_equals('{{#invoke:YouTubeSubscribers|date|qid=Q24088544}}', 'September 2025')
self:preprocess_equals('{{#invoke:YouTubeSubscribers|date|qid=Q5}}', '<strong class="error"><span class="scribunto-error mw-scribunto-error-e171b741">Lua error in Module:YouTubeSubscribers at line 211: Could not find a single best YouTube channel ID for this item. Add a YouTube channel ID or set the rank of one channel ID to be preferred.</span></strong>')
self:preprocess_equals('{{#invoke:YouTubeSubscribers|date|qid=Q999999999999}}', '<strong class="error"><span class="scribunto-error mw-scribunto-error-5e455087">The ID "Q999999999999" is unknown to the system. Please use a valid entity ID.</span></strong>')
self:preprocess_equals('{{#invoke:YouTubeSubscribers|date|qid=Q4115189}}', '<strong class="error"><span class="scribunto-error mw-scribunto-error-1c89491b">Lua error in Module:YouTubeSubscribers at line 211: Could not find a single best YouTube channel ID for this item. Add a YouTube channel ID or set the rank of one channel ID to be preferred.</span></strong>')
end
return p