tests.wikibase_tests module#

Tests for the Wikidata parts of the page module.

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

Bases: DisconnectedSiteMixin, WikidataTestCase

Test cases to test namespaces of Wikibase entities.

abstract_class = False#
cached = False#
code = 'wikidata'#
dry = True#
family = 'wikidata'#
classmethod setUpClass()[source]#

Setup test class.

site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_alternate_item_namespace()[source]#

Test alternate item namespace.

test_alternate_property_namespace()[source]#

Test alternate property namespace.

wikibase = True#
class tests.wikibase_tests.TestClaim(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, ForceCacheMixin, WikidataTestCase

Test Claim object functionality.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_claim_copy_is_equal()[source]#

Test making a copy of a claim.

The copy of a claim should be always equal to the claim.

test_claim_copy_is_equal_qualifier()[source]#

Test making a copy of a claim.

The copy of a qualifier should be always equal to the qualifier.

test_claim_copy_is_equal_source()[source]#

Test making a copy of a claim.

The copy of a source should be always equal to the source.

test_claim_eq_one_without_qualifiers()[source]#

Test comparing two claims.

If they have the same property and value and one of them has no qualifiers while the other one does, they are not equal.

test_claim_eq_simple()[source]#

Test comparing two claims.

If they have the same property and value, they are equal.

test_claim_eq_simple_different_property()[source]#

Test comparing two claims.

If they have the same value and different properties, they are not equal.

test_claim_eq_simple_different_rank()[source]#

Test comparing two claims.

If they have the same property and value and different ranks, they are equal.

test_claim_eq_simple_different_snaktype()[source]#

Test comparing two claims.

If they have the same property and different snaktypes, they are not equal.

test_claim_eq_simple_different_value()[source]#

Test comparing two claims.

If they have the same property and different values, they are not equal.

test_claim_eq_with_different_qualifiers()[source]#

Test comparing two claims.

If they have the same property and value and different qualifiers, they are not equal.

test_claim_eq_with_different_sources()[source]#

Test comparing two claims.

If they have the same property and value and different sources, they are equal.

test_claim_eq_with_qualifiers()[source]#

Test comparing two claims.

If they have the same property, value and qualifiers, they are equal.

wikibase = True#
class tests.wikibase_tests.TestClaimSetValue(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, ForceCacheMixin, WikidataTestCase

Test setting claim values.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_set_WbMonolingualText()[source]#

Test setting claim of monolingualtext type.

test_set_WbQuantity()[source]#

Test setting claim of quantity type.

test_set_date()[source]#

Test setting claim of time type.

test_set_identifier()[source]#

Test setting claim of external-id type.

test_set_incorrect_target_value()[source]#

Test setting claim of the incorrect value.

test_set_math()[source]#

Test setting claim of math type.

test_set_musical_notation()[source]#

Test setting claim of musical-notation type.

test_set_website()[source]#

Test setting claim of url type.

wikibase = True#
class tests.wikibase_tests.TestGeneral(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, ForceCacheMixin, WikidataTestCase

General Wikibase tests.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
classmethod setUpClass()[source]#

Setup test class.

site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
testWikibase()[source]#

Wikibase tests.

test_cmp()[source]#

Test WikibasePage comparison.

wikibase = True#
class tests.wikibase_tests.TestItemBasePageMethods(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, ForceCacheMixin, WikidataTestCase, BasePageMethodsTestBase

Test behavior of ItemPage methods inherited from BasePage.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
setUp()[source]#

Setup tests.

site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_basepage_methods()[source]#

Test ItemPage methods inherited from superclass BasePage.

test_item_is_hashable()[source]#

Ensure that ItemPages are hashable.

wikibase = True#
class tests.wikibase_tests.TestItemLoad(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, ForceCacheMixin, WikidataTestCase

Test item creation.

Tests for item creation include: 1. by Q id 2. ItemPage.fromPage(page) 3. ItemPage.fromPage(page_with_props_loaded) 4. ItemPage.from_entity_uri(site, uri)

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

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
setUp()[source]#

Setup test.

classmethod setUpClass()[source]#

Setup test class.

site = True#
sites = {'enwiki': {'code': 'en', 'family': 'wikipedia'}, 'wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_empty_item()[source]#

Test empty wikibase item.

should not raise an error as the constructor only requires the site parameter, with the title parameter defaulted to None.

test_fromPage_lazy()[source]#

Test item from page with lazy_load.

test_fromPage_missing()[source]#

Test item from deleted page.

A deleted page should not have a wikidata item.

test_fromPage_missing_lazy()[source]#

Test lazy loading of item from nonexistent source page.

test_fromPage_noitem()[source]#

Test item from new page.

A new created page should not have a wikidata item yet.

test_fromPage_noprops()[source]#

Test item from page without properties.

test_fromPage_noprops_with_section()[source]#

Test item from page with section.

test_fromPage_props()[source]#

Test item from page with properties.

test_fromPage_redirect()[source]#

Test item from redirect page.

A redirect should not have a wikidata item.

test_from_entity_uri()[source]#

Test ItemPage.from_entity_uri.

test_from_entity_uri_invalid_title()[source]#

Test ItemPage.from_entity_uri with an invalid item title format.

test_from_entity_uri_no_item()[source]#

Test ItemPage.from_entity_uri with non-existent item.

test_from_entity_uri_no_item_lazy()[source]#

Test ItemPage.from_entity_uri with lazy loaded non-existent item.

test_from_entity_uri_not_a_data_repo()[source]#

Test ItemPage.from_entity_uri with a non-Wikibase site.

test_from_entity_uri_wrong_repo()[source]#

Test ItemPage.from_entity_uri with unexpected item repo.

test_item_invalid_titles()[source]#

Test invalid titles of wikibase items.

test_item_lazy_initialization()[source]#

Test that Wikibase items are properly initialized lazily.

test_item_missing()[source]#

Test nmissing item.

test_item_never_existed()[source]#

Test non-existent item.

test_item_normal()[source]#

Test normal wikibase item.

test_item_untrimmed_title()[source]#

Test intrimmed titles of wikibase items.

Spaces in the title should not cause an error.

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.

wikibase = True#
class tests.wikibase_tests.TestItemPageExtensibility(*args, **kwargs)[source]#

Bases: DisconnectedSiteMixin, TestCase

Test ItemPage extensibility.

abstract_class = False#
code = 'en'#
dry = True#
family = 'wikipedia'#
site = True#
sites = {'wikipedia:en': {'code': 'en', 'family': 'wikipedia'}}#
test_ItemPage_extensibility()[source]#

Test ItemPage extensibility.

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

Bases: CheckHostnameMixin, ForceCacheMixin, WikidataTestCase

Test cases to test toJSON() functions.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
setUp()[source]#

Setup test.

site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_itempage_json()[source]#

Test itempage json.

test_json_diff()[source]#

Test json diff.

wikibase = True#

Bases: CheckHostnameMixin, ForceCacheMixin, WikidataTestCase

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.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
setUp()[source]#

Setup Tests.

site = True#
sites = {'afwiki': {'code': 'af', 'family': 'wikipedia'}, 'wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#

Test iterlinks for a given family.

Test iterlinks for page objects.

wikibase = True#
class tests.wikibase_tests.TestLoadRevisionsCaching(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, BasePageLoadRevisionsCachingTestBase, WikidataTestCase

Test site.loadrevisions() caching.

abstract_class = False#
cached = False#
code = 'wikidata'#
family = 'wikidata'#
net = True#
setUp()[source]#

Setup test.

site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_page_text()[source]#

Test site.loadrevisions() with Page.text.

wikibase = True#
class tests.wikibase_tests.TestLoadUnknownType(*args, **kwargs)[source]#

Bases: ForceCacheMixin, DisconnectedSiteMixin, WikidataTestCase

Test unknown datatypes being loaded as WbUnknown.

abstract_class = False#
cached = True#
code = 'wikidata'#
dry = True#
family = 'wikidata'#
setUp()[source]#

Setup test.

site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_load_unknown()[source]#

Ensure unknown value is loaded but raises a warning.

wikibase = True#
class tests.wikibase_tests.TestNamespaces(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, ForceCacheMixin, WikidataTestCase

Test cases to test namespaces of Wikibase entities.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_empty_wikibase_page()[source]#

Test empty wikibase page.

As a base class it should be able to instantiate it with minimal arguments

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.

wikibase = True#
class tests.wikibase_tests.TestOwnClient(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, TestCase

Test that a data repository family can be its own client.

abstract_class = False#
net = True#
site = True#
sites = {'wikidata': {'code': 'wikidata', 'family': 'wikidata', 'title': 'Wikidata:Main Page'}, 'wikidatatest': {'code': 'test', 'family': 'wikidata', 'title': 'Page \\[\\[(wikidata\\:)?test\\:Q5296\\]\\] is a redirect page\\.'}}#
test_own_client_wikidata()#

Test that a data repository family can be its own client on wikidata:wikidata

test_own_client_wikidatatest()#

Test that a data repository family can be its own client on wikidata:test

test_page_from_repository_wikidata()#

Test that page_from_repository method works for wikibase too on wikidata:wikidata

test_page_from_repository_wikidatatest()#

Test that page_from_repository method works for wikibase too on wikidata:test

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

Bases: CheckHostnameMixin, ForceCacheMixin, WikidataTestCase, BasePageMethodsTestBase

Test behavior of Page methods for wikibase item.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
setUp()[source]#

Setup tests.

site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_basepage_methods()[source]#

Test Page methods inherited from superclass BasePage with Q60.

wikibase = True#
class tests.wikibase_tests.TestPreloadingEntityGenerator(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, TestCase

Test preloading item generator.

abstract_class = False#
net = True#
site = True#
sites = {'enwiki': {'code': 'en', 'family': 'wikipedia'}, 'wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_foreign_page_item_gen()[source]#

Test PreloadingEntityGenerator with connected pages.

test_non_item_gen()[source]#

Test PreloadingEntityGenerator with getReferences().

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

Bases: CheckHostnameMixin, ForceCacheMixin, WikidataTestCase

Test PropertyPage.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_as_target()[source]#

Test that PropertyPage can be used as a value.

test_get()[source]#

Test PropertyPage.get() method.

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 and datatype.

test_property_empty_title()[source]#

Test creating a PropertyPage without a title.

wikibase = True#
class tests.wikibase_tests.TestRedirects(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, ForceCacheMixin, WikidataTestCase

Test redirect and non-redirect items.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_normal_item()[source]#

Test normal item.

test_redirect_item()[source]#

Test redirect item.

test_redirect_item_without_get()[source]#

Test redirect item without explicit get operation.

wikibase = True#
class tests.wikibase_tests.TestUnconnectedClient(*args, **kwargs)[source]#

Bases: DisconnectedSiteMixin, TestCase

Test clients not connected to a data repository.

abstract_class = False#
dry = True#
site = True#
sites = {'frwikt': {'code': 'fr', 'family': 'wiktionary', 'page_title': 'and'}, 'species': {'code': 'species', 'family': 'species', 'page_title': 'Main Page'}}#
test_has_data_repository_frwikt()#

Test that site has no data repository on wiktionary:fr

test_has_data_repository_species()#

Test that site has no data repository on species:species

test_not_supported_family_frwikt()#

Test that family without a data repository causes error on wiktionary:fr

test_not_supported_family_species()#

Test that family without a data repository causes error on species:species

test_page_from_repository_fails_frwikt()#

Test that page_from_repository method fails on wiktionary:fr

test_page_from_repository_fails_species()#

Test that page_from_repository method fails on species:species

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

Bases: CheckHostnameMixin, ForceCacheMixin, WbRepresentationTestCase

Test Wikibase WbGeoShape data type (non-dry).

These require non dry tests due to the page.exists() call.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
setUp()[source]#

Setup tests.

site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_WbGeoShape_WbRepresentation_methods()[source]#

Test inherited or extended methods from _WbRepresentation.

test_WbGeoShape_equality()[source]#

Test WbGeoShape equality.

test_WbGeoShape_error_on_non_exitant_page()[source]#

Test WbGeoShape error handling of a non-existant page.

test_WbGeoShape_error_on_non_page()[source]#

Test WbGeoShape error handling when given a non-page.

test_WbGeoShape_error_on_wrong_page_type()[source]#

Test WbGeoShape error handling of a non-map page.

test_WbGeoShape_error_on_wrong_site()[source]#

Test WbGeoShape error handling of a page on non-filerepo site.

test_WbGeoShape_fromWikibase()[source]#

Test WbGeoShape.fromWikibase() instantiating.

test_WbGeoShape_page()[source]#

Test WbGeoShape page.

test_WbGeoShape_page_and_site()[source]#

Test WbGeoShape from page and site.

wikibase = True#
class tests.wikibase_tests.TestWbMonolingualText(*args, **kwargs)[source]#

Bases: ForceCacheMixin, DisconnectedSiteMixin, WbRepresentationTestCase

Test Wikibase WbMonolingualText data type.

abstract_class = False#
cached = True#
code = 'wikidata'#
dry = True#
family = 'wikidata'#
site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_WbMonolingualText_WbRepresentation_methods()[source]#

Test inherited or extended methods from _WbRepresentation.

test_WbMonolingualText_equality()[source]#

Test WbMonolingualText equality.

test_WbMonolingualText_errors()[source]#

Test WbMonolingualText error handling.

test_WbMonolingualText_fromWikibase()[source]#

Test WbMonolingualText.fromWikibase() instantiating.

test_WbMonolingualText_string()[source]#

Test WbMonolingualText string.

test_WbMonolingualText_unicode()[source]#

Test WbMonolingualText unicode.

wikibase = True#
class tests.wikibase_tests.TestWbQuantity(*args, **kwargs)[source]#

Bases: ForceCacheMixin, DisconnectedSiteMixin, WbRepresentationTestCase

Test Wikibase WbQuantity data type.

abstract_class = False#
cached = True#
code = 'wikidata'#
dry = True#
family = 'wikidata'#
site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_WbQuantity_WbRepresentation_methods()[source]#

Test inherited or extended methods from _WbRepresentation.

test_WbQuantity_decimal()[source]#

Test WbQuantity for decimal value.

test_WbQuantity_entity_unit()[source]#

Test WbQuantity with entity uri unit.

test_WbQuantity_errors()[source]#

Test WbQuantity error handling.

test_WbQuantity_float_27()[source]#

Test WbQuantity for float value.

test_WbQuantity_formatting_bound()[source]#

Test WbQuantity formatting with bounds.

test_WbQuantity_fromWikibase()[source]#

Test WbQuantity.fromWikibase() instantiating.

test_WbQuantity_integer()[source]#

Test WbQuantity for integer value.

test_WbQuantity_scientific()[source]#

Test WbQuantity for scientific notation.

test_WbQuantity_self_equality()[source]#

Test WbQuantity equality.

test_WbQuantity_string()[source]#

Test WbQuantity for decimal notation.

test_WbQuantity_unit_fromWikibase()[source]#

Test WbQuantity recognising unit from Wikibase output.

wikibase = True#
class tests.wikibase_tests.TestWbQuantityNonDry(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, ForceCacheMixin, WbRepresentationTestCase

Test Wikibase WbQuantity data type (non-dry).

These can be moved to TestWbQuantity once DrySite has been bumped to the appropriate version.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
setUp()[source]#

Override setup to store repo and it’s version.

site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_WbQuantity_ItemPage_unit()[source]#

Test WbQuantity with ItemPage unit.

test_WbQuantity_equality()[source]#

Test WbQuantity equality with different unit representations.

test_WbQuantity_formatting_unbound()[source]#

Test WbQuantity formatting without bounds.

test_WbQuantity_fromWikibase_unbound()[source]#

Test WbQuantity.fromWikibase() instantiating without bounds.

test_WbQuantity_get_unit_item()[source]#

Test getting unit item from WbQuantity.

test_WbQuantity_get_unit_item_different_repo()[source]#

Test getting unit item in different repo from WbQuantity.

test_WbQuantity_get_unit_item_provide_repo()[source]#

Test getting unit item from WbQuantity, providing repo.

test_WbQuantity_unbound()[source]#

Test WbQuantity for value without bounds.

wikibase = True#
class tests.wikibase_tests.TestWbTabularDataNonDry(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, ForceCacheMixin, WbRepresentationTestCase

Test Wikibase WbTabularData data type (non-dry).

These require non dry tests due to the page.exists() call.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
setUp()[source]#

Setup tests.

site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_WbTabularData_WbRepresentation_methods()[source]#

Test inherited or extended methods from _WbRepresentation.

test_WbTabularData_equality()[source]#

Test WbTabularData equality.

test_WbTabularData_error_on_non_exitant_page()[source]#

Test WbTabularData error handling of a non-existant page.

test_WbTabularData_error_on_non_page()[source]#

Test WbTabularData error handling when given a non-page.

test_WbTabularData_error_on_wrong_page_type()[source]#

Test WbTabularData error handling of a non-map page.

test_WbTabularData_error_on_wrong_site()[source]#

Test WbTabularData error handling of a page on non-filerepo site.

test_WbTabularData_fromWikibase()[source]#

Test WbTabularData.fromWikibase() instantiating.

test_WbTabularData_page()[source]#

Test WbTabularData page.

test_WbTabularData_page_and_site()[source]#

Test WbTabularData from page and site.

wikibase = True#
class tests.wikibase_tests.TestWbTime(*args, **kwargs)[source]#

Bases: ForceCacheMixin, DisconnectedSiteMixin, WbRepresentationTestCase

Test Wikibase WbTime data type.

abstract_class = False#
cached = True#
code = 'wikidata'#
dry = True#
family = 'wikidata'#
site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_WbTime_WbRepresentation_methods()[source]#

Test inherited or extended methods from _WbRepresentation.

test_WbTime_errors()[source]#

Test WbTime precision errors.

test_WbTime_fromTimestr()[source]#

Test WbTime creation from UTC date/time string.

test_WbTime_timestamp()[source]#

Test timestamp functions of WbTime.

test_WbTime_timestr()[source]#

Test timestr functions of WbTime.

test_WbTime_zero_month()[source]#

Test WbTime creation from date/time string with zero month.

wikibase = True#
class tests.wikibase_tests.TestWbUnknown(*args, **kwargs)[source]#

Bases: ForceCacheMixin, DisconnectedSiteMixin, WbRepresentationTestCase

Test Wikibase WbUnknown data type.

abstract_class = False#
cached = True#
code = 'wikidata'#
dry = True#
family = 'wikidata'#
site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_WbUnknown_WbRepresentation_methods()[source]#

Test inherited or extended methods from _WbRepresentation.

test_WbUnknown_equality()[source]#

Test WbUnknown equality.

test_WbUnknown_fromWikibase()[source]#

Test WbUnknown.fromWikibase() instantiating.

test_WbUnknown_string()[source]#

Test WbUnknown string.

wikibase = True#
class tests.wikibase_tests.TestWikibaseCoordinate(*args, **kwargs)[source]#

Bases: ForceCacheMixin, DisconnectedSiteMixin, WbRepresentationTestCase

Test Wikibase Coordinate data type.

abstract_class = False#
cached = True#
code = 'wikidata'#
dry = True#
family = 'wikidata'#
site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_Coordinate_WbRepresentation_methods()[source]#

Test inherited or extended methods from _WbRepresentation.

test_Coordinate_dim()[source]#

Test Coordinate dimension.

test_Coordinate_entity_uri_globe()[source]#

Test setting Coordinate globe from an entity uri.

test_Coordinate_plain_globe()[source]#

Test setting Coordinate globe from a plain-text value.

wikibase = True#
class tests.wikibase_tests.TestWikibaseCoordinateNonDry(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, ForceCacheMixin, WbRepresentationTestCase

Test Wikibase Coordinate data type (non-dry).

These can be moved to TestWikibaseCoordinate once DrySite has been bumped to the appropriate version.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_Coordinate_equality()[source]#

Test Coordinate equality with different globe representations.

test_Coordinate_get_globe_item_different_repo()[source]#

Test getting globe item in different repo from Coordinate.

test_Coordinate_get_globe_item_from_itempage()[source]#

Test getting globe item from Coordinate with ItemPage globe.

test_Coordinate_get_globe_item_from_plain_globe()[source]#

Test getting globe item from Coordinate with plain text globe.

test_Coordinate_get_globe_item_from_uri()[source]#

Test getting globe item from Coordinate with entity uri globe.

test_Coordinate_get_globe_item_provide_repo()[source]#

Test getting globe item from Coordinate, providing repo.

test_Coordinate_item_globe()[source]#

Test setting Coordinate globe from an ItemPage.

wikibase = True#
class tests.wikibase_tests.TestWikibaseParser(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, ForceCacheMixin, WikidataTestCase

Test passing various datatypes to wikibase parser.

abstract_class = False#
cached = True#
code = 'wikidata'#
family = 'wikidata'#
net = True#
site = True#
sites = {'wikidata:wikidata': {'code': 'wikidata', 'family': 'wikidata'}}#
test_wbparse_quantity()[source]#

Test parsing of quantity values.

test_wbparse_raises_valueerror()[source]#

Test invalid value condition.

test_wbparse_strings()[source]#

Test that strings return unchanged.

test_wbparse_time()[source]#

Test parsing of a time value.

wikibase = True#
class tests.wikibase_tests.TestWriteNormalizeData(*args, **kwargs)[source]#

Bases: DisableSiteMixin, TestCase

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

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

abstract_class = False#
setUp()[source]#

Setup tests.

test_normalize_data()[source]#

Test _normalizeData() method.

test_normalized_data()[source]#

Test _normalizeData() method for normalized data.

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

Bases: WikidataTestCase

Test methods inherited or extended from _WbRepresentation.

abstract_class = True#