wikibase_tests

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_cmp()[source]

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_fromPage_missing_lazy()[source]

Test lazy loading of item from nonexistent source page.

test_load_item_set_id()[source]

Test setting item.id attribute on empty item.

test_reuse_item_set_id()[source]

Test modifying item.id attribute.

Some scripts are using item.id = ‘Q60’ semantics, which does work but modifying item.id 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_item_unknown_namespace()[source]

Test unknown namespaces for Wikibase entities.

Test the title resolved to a namespace correctly.

test_wikibase_namespace_selection()[source]

Test various ways to correctly specify the namespace.

test_wrong_namespaces()[source]

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_item_bot_may_edit()[source]

Test botMayEdit.

test_item_templates()[source]

Test templatesWithParams.

test_page_methods()[source]

Test ItemPage methods inherited from superclass Page.

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

Test preloading item generator.

test_non_item_gen()[source]

Test TestPreloadingItemGenerator with ReferringPageGenerator.

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

Test PropertyPage.

test_globe_coordinate()[source]

Test a coordinate PropertyPage has the correct type.

test_new_claim()[source]

Test that PropertyPage.newClaim uses cached datatype.

test_property_empty_property()[source]

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.