Tests in tests.wikibase_tests:

Available tests

class tests.wikibase_tests.TestAlternateNamespaces(*args, **kwargs)[source]

Test cases to test namespaces of Wikibase entities.

class tests.wikibase_tests.TestClaimSetValue(*args, **kwargs)[source]

Test setting claim values.

class tests.wikibase_tests.TestGeneral(*args, **kwargs)[source]

General Wikibase tests.


Test WikibasePage.__cmp__.

class tests.wikibase_tests.TestItemLoad(*args, **kwargs)[source]

Test item creation.

Tests for item creation include:: 1. by Q id 2. ItemPage.fromPage(page) 3. ItemPage.fromPage(page_with_props_loaded)

Test various invalid scenarios:: 1. invalid Q ids 2. invalid pages to fromPage 3. missing pages to fromPage 4. unconnected pages to fromPage


Test lazy loading of item from nonexistent source page.


Test setting attribute on empty item.


Test modifying attribute.

Some scripts are using = ‘Q60’ semantics, which does work but modifying does not currently work, and this test highlights that it breaks silently.

class tests.wikibase_tests.TestItemPageExtensibility(*args, **kwargs)[source]

Test ItemPage extensibility.

class tests.wikibase_tests.TestJSON(*args, **kwargs)[source]

Test cases to test toJSON() functions.

Test cases to test links stored in Wikidata.

Uses a stored data file for the wikibase item. However wikibase creates site objects for each sitelink, and the unit test directly creates a Site for ‘wikipedia:af’ to use in a comparison.

class tests.wikibase_tests.TestNamespaces(*args, **kwargs)[source]

Test cases to test namespaces of Wikibase entities.


Test unknown namespaces for Wikibase entities.

Test the title resolved to a namespace correctly.


Test various ways to correctly specify the namespace.


Test incorrect namespaces for Wikibase entities.

class tests.wikibase_tests.TestPageMethods(*args, **kwargs)[source]

Test cases to test methods of Page() behave correctly with Wikibase.


Test botMayEdit.


Test templatesWithParams.


Test ItemPage methods inherited from superclass Page.

class tests.wikibase_tests.TestPreloadingItemGenerator(*args, **kwargs)[source]

Test preloading item generator.


Test TestPreloadingItemGenerator with ReferringPageGenerator.

class tests.wikibase_tests.TestPropertyPage(*args, **kwargs)[source]

Test PropertyPage.


Test a coordinate PropertyPage has the correct type.


Test that PropertyPage.newClaim uses cached datatype.


Test creating a PropertyPage without a title.

class tests.wikibase_tests.TestRedirects(*args, **kwargs)[source]

Test redirect and non-redirect items.

class tests.wikibase_tests.TestWikibaseTypes(*args, **kwargs)[source]

Test Wikibase data types.

class tests.wikibase_tests.TestWriteNormalizeData(*args, **kwargs)[source]

Test cases for routines that normalize data for writing to Wikidata.

Exercises WikibasePage._normalizeData with data that is not normalized and data which is already normalized.

class tests.wikibase_tests.TestWriteNormalizeLang(*args, **kwargs)[source]

Test cases for routines that normalize languages in a dict.

Exercises WikibasePage._normalizeLanguages with data that is not normalized and data which is already normalized.