Module:Wikidata/testcases

From OODA WIKI

Documentation for this module may be created at Module:Wikidata/testcases/doc

-- Unit tests for [[Module:Wikidata]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_Wikidata()
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P19|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P26|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P27|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P140|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P178|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P275|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P140|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P140|qid=Q48493|FETCH_WIKIDATA2}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getRawValue|P178|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getRawValue|P275|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getRawValue|P140|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getRawValue|P140|qid=Q48493|FETCH_WIKIDATA2}}', '')

    self:preprocess_equals('{{#invoke:Wikidata|getRawValue|P21|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|dmy}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|mdy}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue}}', '')end

function p:test_WikidataSandbox()
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getValue|P19|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getValue|P26|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getValue|P27|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getValue|P140|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getValue|P178|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getValue|P275|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getValue|P140|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getValue|P140|qid=Q48493|FETCH_WIKIDATA2}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getRawValue|P178|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getRawValue|P275|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getRawValue|P140|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getRawValue|P140|qid=Q48493|FETCH_WIKIDATA2}}', '')

    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getRawValue|P21|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getDateValue|P569|FETCH_WIKIDATA|dmy}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getDateValue|P569|FETCH_WIKIDATA|mdy}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getDateValue|P569|FETCH_WIKIDATA|y}}', '')
    self:preprocess_equals('{{#invoke:Wikidata/sandbox|getValue}}', '')
end

return p