tests.site_generators_tests module#
Tests for generators of the site module.
- class tests.site_generators_tests.SearchTestCase(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,DefaultSiteTestCase
Test search method.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.SiteRandomTestCase(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,DefaultSiteTestCase
Test random methods of a site.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.SiteWatchlistRevsTestCase(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,CheckHostnameMixin
,DefaultSiteTestCase
Test site method watchlist_revs().
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.TestAlldeletedrevisionsAsUser(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,CheckHostnameMixin
,DefaultSiteTestCase
Test site method site.alldeletedrevisions() with bot user.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.TestAlldeletedrevisionsWithoutUser(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,DefaultSiteTestCase
Test site method site.alldeletedrevisions() without bot user.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.TestBacklinks(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,TestCase
Test for backlinks (issue T194233).
- abstract_class = False#
- cached = True#
- code = 'en'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:en': {'code': 'en', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.TestFileArchive(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,DeprecationTestCase
Test filearchive 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_generators_tests.TestImageUsage(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,DefaultSiteTestCase
Test cases for Site.imageusage method.
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- property imagepage#
Find an image which is used on the main page.
If there are no images included in main page it’ll skip all tests.
Note
This is not implemented as setUpClass which would be invoked while initialising all tests, to reduce chance of an error preventing all tests from running.
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.TestLoadPagesFromPageids(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,DefaultSiteTestCase
Test site.load_pages_from_pageids().
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.TestLogEvents(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,DefaultSiteTestCase
Test logevents methods.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.TestPagePreloading(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,DefaultSiteTestCase
Test site.preloadpages().
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- test_preload_high_groupsize()[source]#
Test preloading continuation with groupsize greater than total.
- test_preload_invalid_titles_without_pageids()[source]#
Test sending invalid titles. No warnings issued, but it should.
- test_preload_low_groupsize()[source]#
Test preloading continuation with groupsize greater than total.
- test_preload_unexpected_titles_using_pageids()[source]#
Test sending pageids with unnormalized titles, causing warnings.
- class tests.site_generators_tests.TestRecentChanges(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,DefaultSiteTestCase
Test recentchanges method.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.TestSiteAPILimits(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,TestCase
Test cases for Site method that use API limits.
- abstract_class = False#
- cached = True#
- code = 'en'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:en': {'code': 'en', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.TestSiteGenerators(*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_generators_tests.TestSiteGeneratorsUsers(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,DefaultSiteTestCase
Test cases for Site methods with users.
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.TestSiteLoadRevisions(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,TestCase
Test cases for Site.loadrevision() method.
- abstract_class = False#
- cached = True#
- code = 'en'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:en': {'code': 'en', 'family': 'wikipedia'}}#
- test_loadrevisions_querycontinue()[source]#
Test the site.loadrevisions() method with query-continue.
- class tests.site_generators_tests.TestUserContribsAsUser(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,CheckHostnameMixin
,DefaultSiteTestCase
Test site method site.usercontribs() with bot user.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.TestUserContribsWithoutUser(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,DefaultSiteTestCase
Test site method site.usercontribs() without bot user.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.TestUserList(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,DefaultSiteTestCase
Test usernames Jimbo Wales, Brion VIBBER and Tim Starling.
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.site_generators_tests.TestUserRecentChanges(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,CheckHostnameMixin
,DefaultSiteTestCase
Test recentchanges method requiring 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_generators_tests.TestUserWatchedPages(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,CheckHostnameMixin
,DefaultSiteTestCase
Test user watched pages.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#