tests.script_tests module#
Test that each script can be compiled and executed.
- class tests.script_tests.TestScriptGenerator(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,CheckHostnameMixin
,DefaultSiteTestCase
,PwbTestCase
Test cases for running scripts with a generator.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- pwb = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- test__login()#
Test running login -simulate -page:Foo -always.
- test_add_text()#
Test running add_text -simulate -page:Foo -always.
- test_archivebot()#
Test running archivebot -simulate -page:Foo -always.
- test_basic()#
Test running basic -simulate -page:Foo -always.
- test_blockpageschecker()#
Test running blockpageschecker -simulate -page:Foo -always.
- test_category()#
Test running category -simulate -page:Foo -always.
- test_category_redirect()#
Test running category_redirect -simulate -page:Foo -always.
- test_change_pagelang()#
Test running change_pagelang -simulate -page:Foo -always.
- test_checkimages()#
Test running checkimages -simulate -page:Foo -always.
- test_claimit()#
Test running claimit -simulate -page:Foo -always.
- test_clean_sandbox()#
Test running clean_sandbox -simulate -page:Foo -always.
- test_commons_information()#
Test running commons_information -simulate -page:Foo -always.
- test_commonscat()#
Test running commonscat -simulate -page:Foo -always.
- test_coordinate_import()#
Test running coordinate_import -simulate -page:Foo -always.
- test_cosmetic_changes()#
Test running cosmetic_changes -simulate -page:Foo -always.
- test_create_isbn_edition()#
Test running create_isbn_edition -simulate -page:Foo -always.
- test_data_ingestion()#
Test running data_ingestion -simulate -page:Foo -always.
- test_dataextend()#
Test running dataextend -simulate -page:Foo -always.
- test_delete()#
Test running delete -simulate -page:Foo -always.
- test_delinker()#
Test running delinker -simulate -page:Foo -always.
- test_djvutext()#
Test running djvutext -simulate -page:Foo -always.
- test_download_dump()#
Test running download_dump -simulate -page:Foo -always.
- test_fixing_redirects()#
Test running fixing_redirects -simulate -page:Foo -always.
- test_harvest_template()#
Test running harvest_template -simulate -page:Foo -always.
- test_illustrate_wikidata()#
Test running illustrate_wikidata -simulate -page:Foo -always.
- test_image()#
Test running image -simulate -page:Foo -always.
- test_imagetransfer()#
Test running imagetransfer -simulate -page:Foo -always.
- test_interwiki()#
Test running interwiki -simulate -page:Foo -always.
- test_interwikidata()#
Test running interwikidata -simulate -page:Foo -always.
- test_listpages()#
Test running listpages -simulate -page:Foo -always.
- test_misspelling()#
Test running misspelling -simulate -page:Foo -always.
- test_movepages()#
Test running movepages -simulate -page:Foo -always.
- test_newitem()#
Test running newitem -simulate -page:Foo -always.
- test_noreferences()#
Test running noreferences -simulate -page:Foo -always.
- test_nowcommons()#
Test running nowcommons -simulate -page:Foo -always.
- test_pagefromfile()#
Test running pagefromfile -simulate -page:Foo -always.
- test_parser_function_count()#
Test running parser_function_count -simulate -page:Foo -always.
- test_patrol()#
Test running patrol -simulate -page:Foo -always.
- test_protect()#
Test running protect -simulate -page:Foo -always.
- test_redirect()#
Test running redirect -simulate -page:Foo -always.
- test_reflinks()#
Test running reflinks -simulate -page:Foo -always.
- test_replace()#
Test running replace -simulate -page:Foo -always.
- test_replicate_wiki()#
Test running replicate_wiki -simulate -page:Foo -always.
- test_revertbot()#
Test running revertbot -simulate -page:Foo -always.
- test_shell()#
Test running shell -simulate -page:Foo -always.
- test_solve_disambiguation()#
Test running solve_disambiguation -simulate -page:Foo -always.
- test_speedy_delete()#
Test running speedy_delete -simulate -page:Foo -always.
- test_template()#
Test running template -simulate -page:Foo -always.
- test_templatecount()#
Test running templatecount -simulate -page:Foo -always.
- test_touch()#
Test running touch -simulate -page:Foo -always.
- test_transferbot()#
Test running transferbot -simulate -page:Foo -always.
- test_unusedfiles()#
Test running unusedfiles -simulate -page:Foo -always.
- test_upload()#
Test running upload -simulate -page:Foo -always.
- test_watchlist()#
Test running watchlist -simulate -page:Foo -always.
- test_weblinkchecker()#
Test running weblinkchecker -simulate -page:Foo -always.
- test_welcome()#
Test running welcome -simulate -page:Foo -always.
- class tests.script_tests.TestScriptHelp(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,PwbTestCase
Test cases for running scripts with -help.
All scripts should not create a Site for -help, so net = False.
- abstract_class = False#
- pwb = True#
- test__login()#
Test running login -help.
- test_add_text()#
Test running add_text -help.
- test_archivebot()#
Test running archivebot -help.
- test_basic()#
Test running basic -help.
- test_blockpageschecker()#
Test running blockpageschecker -help.
- test_category()#
Test running category -help.
- test_category_redirect()#
Test running category_redirect -help.
- test_change_pagelang()#
Test running change_pagelang -help.
- test_checkimages()#
Test running checkimages -help.
- test_claimit()#
Test running claimit -help.
- test_clean_sandbox()#
Test running clean_sandbox -help.
- test_commons_information()#
Test running commons_information -help.
- test_commonscat()#
Test running commonscat -help.
- test_coordinate_import()#
Test running coordinate_import -help.
- test_cosmetic_changes()#
Test running cosmetic_changes -help.
- test_create_isbn_edition()#
Test running create_isbn_edition -help.
- test_data_ingestion()#
Test running data_ingestion -help.
- test_dataextend()#
Test running dataextend -help.
- test_delete()#
Test running delete -help.
- test_delinker()#
Test running delinker -help.
- test_djvutext()#
Test running djvutext -help.
- test_download_dump()#
Test running download_dump -help.
- test_fixing_redirects()#
Test running fixing_redirects -help.
- test_harvest_template()#
Test running harvest_template -help.
- test_illustrate_wikidata()#
Test running illustrate_wikidata -help.
- test_image()#
Test running image -help.
- test_imagetransfer()#
Test running imagetransfer -help.
- test_interwiki()#
Test running interwiki -help.
- test_interwikidata()#
Test running interwikidata -help.
- test_listpages()#
Test running listpages -help.
- test_misspelling()#
Test running misspelling -help.
- test_movepages()#
Test running movepages -help.
- test_newitem()#
Test running newitem -help.
- test_noreferences()#
Test running noreferences -help.
- test_nowcommons()#
Test running nowcommons -help.
- test_pagefromfile()#
Test running pagefromfile -help.
- test_parser_function_count()#
Test running parser_function_count -help.
- test_patrol()#
Test running patrol -help.
- test_protect()#
Test running protect -help.
- test_redirect()#
Test running redirect -help.
- test_reflinks()#
Test running reflinks -help.
- test_replace()#
Test running replace -help.
- test_replicate_wiki()#
Test running replicate_wiki -help.
- test_revertbot()#
Test running revertbot -help.
- test_shell()#
Test running shell -help.
- test_solve_disambiguation()#
Test running solve_disambiguation -help.
- test_speedy_delete()#
Test running speedy_delete -help.
- test_template()#
Test running template -help.
- test_templatecount()#
Test running templatecount -help.
- test_touch()#
Test running touch -help.
- test_transferbot()#
Test running transferbot -help.
- test_unusedfiles()#
Test running unusedfiles -help.
- test_upload()#
Test running upload -help.
- test_watchlist()#
Test running watchlist -help.
- test_weblinkchecker()#
Test running weblinkchecker -help.
- test_welcome()#
Test running welcome -help.
- class tests.script_tests.TestScriptMeta(name, bases, dct)[source]#
Bases:
MetaTestCaseClass
Test meta class.
Create the new class.
- class tests.script_tests.TestScriptSimulate(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,CheckHostnameMixin
,DefaultSiteTestCase
,PwbTestCase
Test cases for running scripts with -siumlate.
This class sets the ‘user’ attribute on every test, thereby ensuring that the test runner has a username for the default site, and so that Site.login() is called in the test runner, which means that the scripts run in pwb can automatically login using the saved cookies.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- pwb = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- test__login()#
Test running login -simulate.
- test_add_text()#
Test running add_text -simulate.
- test_archivebot()#
Test running archivebot -simulate.
- test_basic()#
Test running basic -simulate.
- test_blockpageschecker()#
Test running blockpageschecker -simulate.
- test_category()#
Test running category -simulate.
- test_category_redirect()#
Test running category_redirect -simulate.
- test_change_pagelang()#
Test running change_pagelang -simulate.
- test_checkimages()#
Test running checkimages -simulate.
- test_claimit()#
Test running claimit -simulate.
- test_clean_sandbox()#
Test running clean_sandbox -simulate.
- test_commons_information()#
Test running commons_information -simulate.
- test_commonscat()#
Test running commonscat -simulate.
- test_coordinate_import()#
Test running coordinate_import -simulate.
- test_cosmetic_changes()#
Test running cosmetic_changes -simulate.
- test_create_isbn_edition()#
Test running create_isbn_edition -simulate.
- test_data_ingestion()#
Test running data_ingestion -simulate.
- test_dataextend()#
Test running dataextend -simulate.
- test_delete()#
Test running delete -simulate.
- test_delinker()#
Test running delinker -simulate.
- test_djvutext()#
Test running djvutext -simulate.
- test_download_dump()#
Test running download_dump -simulate.
- test_fixing_redirects()#
Test running fixing_redirects -simulate.
- test_harvest_template()#
Test running harvest_template -simulate.
- test_illustrate_wikidata()#
Test running illustrate_wikidata -simulate.
- test_image()#
Test running image -simulate.
- test_imagetransfer()#
Test running imagetransfer -simulate.
- test_interwiki()#
Test running interwiki -simulate.
- test_interwikidata()#
Test running interwikidata -simulate.
- test_listpages()#
Test running listpages -simulate.
- test_misspelling()#
Test running misspelling -simulate.
- test_movepages()#
Test running movepages -simulate.
- test_newitem()#
Test running newitem -simulate.
- test_noreferences()#
Test running noreferences -simulate.
- test_nowcommons()#
Test running nowcommons -simulate.
- test_pagefromfile()#
Test running pagefromfile -simulate.
- test_parser_function_count()#
Test running parser_function_count -simulate.
- test_patrol()#
Test running patrol -simulate.
- test_protect()#
Test running protect -simulate.
- test_redirect()#
Test running redirect -simulate.
- test_reflinks()#
Test running reflinks -simulate.
- test_replace()#
Test running replace -simulate.
- test_replicate_wiki()#
Test running replicate_wiki -simulate.
- test_revertbot()#
Test running revertbot -simulate.
- test_shell()#
Test running shell -simulate.
- test_solve_disambiguation()#
Test running solve_disambiguation -simulate.
- test_speedy_delete()#
Test running speedy_delete -simulate.
- test_template()#
Test running template -simulate.
- test_templatecount()#
Test running templatecount -simulate.
- test_touch()#
Test running touch -simulate.
- test_transferbot()#
Test running transferbot -simulate.
- test_unusedfiles()#
Test running unusedfiles -simulate.
- test_upload()#
Test running upload -simulate.
- test_watchlist()#
Test running watchlist -simulate.
- test_weblinkchecker()#
Test running weblinkchecker -simulate.
- test_welcome()#
Test running welcome -simulate.
- tests.script_tests.auto_run_script_set = {'archivebot', 'blockpageschecker', 'category_redirect', 'checkimages', 'clean_sandbox', 'create_isbn_edition', 'delinker', 'login', 'misspelling', 'noreferences', 'nowcommons', 'parser_function_count', 'patrol', 'revertbot', 'shell', 'unusedfiles', 'upload', 'watchlist', 'welcome'}#
- tests.script_tests.check_script_deps(script_name)[source]#
Detect whether all dependencies are installed.
- tests.script_tests.collector(loader=<unittest.loader.TestLoader object>)[source]#
Load the default tests.