tests.site_tests module#
Tests for the site module.
- class tests.site_tests.SiteSysopTestCase(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,NeedRightsMixin
,CheckHostnameMixin
,DefaultSiteTestCase
Test site method using a sysop account.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- rights = 'delete'#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_tests.SiteUserTestCase(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,CheckHostnameMixin
,DefaultSiteTestCase
Test site method using a user.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_tests.TestCategoryFromWikibase(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,DefaultSiteTestCase
Test page_from_repository method.
- ITEM = 'Q6939656'#
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'de-wp': {'code': 'de', 'family': 'wikipedia', 'result': 'Kategorie:2016'}, 'en-wp': {'code': 'en', 'family': 'wikipedia', 'result': 'Category:2016'}, 'it-ws': {'code': 'it', 'family': 'wikisource', 'result': 'Categoria:2016'}}#
- test_page_from_repository_de_wp()#
Validate page_from_repository on wikipedia:de
- test_page_from_repository_en_wp()#
Validate page_from_repository on wikipedia:en
- test_page_from_repository_it_ws()#
Validate page_from_repository on wikisource:it
- class tests.site_tests.TestCommonsSite(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,TestCase
Test cases for Site methods on Commons.
- abstract_class = False#
- cached = True#
- code = 'commons'#
- family = 'commons'#
- net = True#
- site = True#
- sites = {'commons:commons': {'code': 'commons', 'family': 'commons'}}#
- class tests.site_tests.TestLinktrails(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,TestCase
Test linktrail method.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_tests.TestLockingPage(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,DefaultSiteTestCase
Test cases for lock/unlock a page within threads.
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_tests.TestNonEnglishWikipediaSite(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,TestCase
Test Site Object on Nynorsk Wikipedia.
- abstract_class = False#
- cached = True#
- code = 'nn'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:nn': {'code': 'nn', 'family': 'wikipedia'}}#
- class tests.site_tests.TestObsoleteSite(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,DefaultSiteTestCase
Test ‘closed’ and obsolete code sites.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_tests.TestPageFromWikibase(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,DefaultSiteTestCase
Test page_from_repository method.
- ITEM = 'Q131303'#
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'de-wp': {'code': 'de', 'family': 'wikipedia', 'result': 'Hallo-Welt-Programm'}, 'en-wp': {'code': 'en', 'family': 'wikipedia', 'result': '"Hello, World!" program'}, 'it-wb': {'code': 'it', 'family': 'wikibooks', 'result': 'Hello world'}}#
- test_page_from_repository_de_wp()#
Validate page_from_repository on wikipedia:de
- test_page_from_repository_en_wp()#
Validate page_from_repository on wikipedia:en
- test_page_from_repository_it_wb()#
Validate page_from_repository on wikibooks:it
- class tests.site_tests.TestProductionAndTestSite(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,AlteredDefaultSiteTestCase
Test site without other production sites in its family.
- abstract_class = False#
- net = True#
- site = True#
- sites = {'beta': {'code': 'beta', 'family': 'commons'}, 'commons': {'code': 'commons', 'family': 'commons'}, 'wikidata': {'code': 'wikidata', 'family': 'wikidata'}, 'wikidatatest': {'code': 'test', 'family': 'wikidata'}}#
- class tests.site_tests.TestPropertyNames(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,DefaultSiteTestCase
Test Special:PagesWithProp method.
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'de-wp': {'code': 'de', 'family': 'wikipedia'}, 'en-ws': {'code': 'en', 'family': 'wikisource'}}#
- test_get_property_names_de_wp()#
Test get_property_names method on wikipedia:de
- test_get_property_names_en_ws()#
Test get_property_names method on wikisource:en
- class tests.site_tests.TestSametitleSite(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,TestCase
Test APISite.sametitle on sites with known behaviour.
- abstract_class = False#
- net = True#
- site = True#
- sites = {'dewp': {'code': 'de', 'family': 'wikipedia'}, 'enwp': {'code': 'en', 'family': 'wikipedia'}, 'enwt': {'code': 'en', 'family': 'wiktionary'}}#
- test_general_dewp()#
Test sametitle on wikipedia:de
- test_general_enwp()#
Test sametitle on wikipedia:en
- test_general_enwt()#
Test sametitle on wiktionary:en
- class tests.site_tests.TestSingleCodeFamilySite(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,AlteredDefaultSiteTestCase
Test single code family sites.
- abstract_class = False#
- net = True#
- site = True#
- sites = {'i18n': {'code': 'i18n', 'family': 'i18n'}}#
- class tests.site_tests.TestSiteDryDeprecatedFunctions(*args, **kwargs)[source]#
Bases:
DisconnectedSiteMixin
,DefaultDrySiteTestCase
,DeprecationTestCase
Test cases for Site deprecated methods without a user.
- abstract_class = False#
- code = 'test'#
- dry = True#
- family = 'wikipedia'#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_tests.TestSiteExtensions(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,WikimediaDefaultSiteTestCase
Test cases for Site extensions.
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_tests.TestSiteLoadRevisionsCaching(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,BasePageLoadRevisionsCachingTestBase
,DefaultSiteTestCase
Test site.loadrevisions() caching.
- abstract_class = False#
- cached = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_tests.TestSiteObject(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,DefaultSiteTestCase
Test cases for Site methods.
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_tests.TestSiteObjectDeprecatedFunctions(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,DefaultSiteTestCase
,DeprecationTestCase
Test cases for Site deprecated methods on a live wiki.
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_tests.TestSiteProofreadinfo(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,DefaultSiteTestCase
Test proofreadinfo information.
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'en-wp': {'code': 'en', 'family': 'wikipedia'}, 'en-ws': {'code': 'en', 'family': 'wikisource'}}#
- class tests.site_tests.TestSiteSysopWrite(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,NeedRightsMixin
,SiteWriteMixin
,CheckHostnameMixin
,TestCase
Test site methods that require writing rights.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- rights = 'delete,deleterevision,protect'#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- write = True#
- class tests.site_tests.TestSubdomainFamilySite(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,TestCase
Test subdomain family site.
- abstract_class = False#
- code = 'en'#
- family = 'wowwiki'#
- net = True#
- site = True#
- sites = {'wowwiki:en': {'code': 'en', 'family': 'wowwiki'}}#
- class tests.site_tests.TestUploadEnabledSite(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,CheckHostnameMixin
,TestCase
Test Site.is_uploaddisabled.
- abstract_class = False#
- login = True#
- net = True#
- site = True#
- sites = {'wikidatatest': {'code': 'test', 'disabled': True, 'family': 'wikidata'}, 'wikipediatest': {'code': 'test', 'disabled': False, 'family': 'wikipedia'}}#
- test_is_uploaddisabled_wikidatatest()#
Test is_uploaddisabled() on wikidata:test
- test_is_uploaddisabled_wikipediatest()#
Test is_uploaddisabled() on wikipedia:test
- class tests.site_tests.TestUsernameInUsers(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,CheckHostnameMixin
,ForceCacheMixin
,DefaultSiteTestCase
Test that the user account can be found in users list.
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_tests.TestWiktionarySite(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,TestCase
Test Site Object on English Wiktionary.
- abstract_class = False#
- cached = True#
- code = 'en'#
- family = 'wiktionary'#
- net = True#
- site = True#
- sites = {'wiktionary:en': {'code': 'en', 'family': 'wiktionary'}}#