Contents Menu Expand Light mode Dark mode Auto light/dark mode
Pywikibot 8.0.2 documentation
Logo
Pywikibot 8.0.2 documentation
previous next modules index

User guide

  • Introduction
  • Framework utility scripts
  • Scripts package
    • Global bot scripts
    • Main bot scripts
    • Auxiliary scripts
    • Administrative scripts
    • General pages changes scripts
    • Categories scripts
    • Images scripts
    • Template scripts
    • Wikibase scripts
    • Non editing scripts
    • Other bot scripts
    • Unsorted scripts
    • Utility scripts
    • Outdated core scripts
    • Outdated compat scripts
  • Global options
  • Frequently asked questions
  • Getting help

Bot developer guide

  • Using pywikibot as library
  • Recipes
  • API reference
    • pywikibot — Base Classes and Functions
    • config — Pywikibot Config File
    • page — MediaWiki Pages
    • proofreadpage — ProofreadPage Extension
    • pagegenerators — Page Generators
    • site — MediaWiki sites
    • login module
    • logentries module
    • family — MediaWiki families
    • families — Family Config Files
    • data — Data Exchange
    • comms — Communication layer
    • exceptions — Exceptions and Warning Classes
    • textlib — Changing Wikitext
    • cosmetic_changes — Cosmetic Changes of Wikitext
    • bot — Classes for Building Bots
    • specialbots — Special Reusable Bots
    • bot_choice — UI Options and Choices
    • userinterfaces — User interfaces
    • logging — Logging Functions
    • daemonize — Daemonize Current Process (Unix only)
    • date — Date Classes and Functions
    • time — Time Classes and Functions
    • diff — Helpers for computing deltas
    • echo — Echo Extension Classes and functions
    • editor — Text editor class
    • fixes — standard fixes for replace.py script
    • flow — Flow Entities
    • i18n — i18n Support
    • plural — i18n Plural rules
    • interwiki_graph — Graphviz Drawing for Interwiki
    • titletranslate — Interwiki Title Translator
    • tools — Miscellaneous Helper Functions
    • xmlreader — XML Reader
    • site_detect — Classes for Detecting MediaWiki Sites
    • throttle — Slow Down Wiki I/O
    • version — Determine Pywikibot Version
    • backports — Python Backports
  • MediaWiki API cross reference

Pywikibot contributor guide

  • Framework utility scripts reference
  • Scripts reference
    • Scripts package
    • Translation files - scripts.i18n
    • Maintenance scripts
    • User scripts - scripts.userscripts
  • Installer scripts
  • Tests reference
    • tests.i18n package
    • tests.pwb package
      • tests.pwb.print_env module
      • tests.pwb.print_locals module
      • tests.pwb.print_unicode module
    • api
    • tests.aspects module
    • tests.basepage module
    • bot
    • cache
    • category
    • tests.conftest module
    • cosmetic_changes
    • date
    • diff
    • djvu
    • dry_api
    • dry_site
    • edit_failure
    • edit
    • eventstreams
    • family
    • file
    • fixes
    • flow_edit
    • flow
    • flow_thanks
    • gui
    • http
    • i18n
    • interwiki_graph
    • interwiki_link
    • l10n
    • link
    • logentries
    • login
    • mediawikiversion
    • memento
    • namespace
    • oauth
    • page
    • pagegenerators
    • paraminfo
    • plural
    • proofreadpage
    • site
    • site_decorators
    • site_generators
    • site_detect
    • sparql
    • tests
    • textlib
    • thanks
    • time
    • timestripper
    • tools_chars
    • tools_deprecate
    • tools_formatter
    • threading
    • tools
    • ui_options
    • ui
    • user
    • tests.utils module
    • wikibase_edit
    • wikibase
    • wikistats
    • xmlreader
    • add_text
    • archivebot
    • category_bot
    • checkimages
    • data_ingestion
    • deletionbot
    • fixing_redirects
    • generate_family_file
    • generate_user_files
    • harvest_template
    • interwikidata
    • make_dist
    • noreferences
    • patrolbot
    • protectbot
    • pwb
    • script
    • redirect_bot
    • reflinks
    • replacebot
    • template_bot
    • upload
    • uploadbot

About

  • Glossary
  • Change log
  • Licenses
  • Credits
Back to top
Edit this page

tests.reflinks_tests module#

Tests for reflinks script.

class tests.reflinks_tests.TestReferencesBotConstructor(*args, **kwargs)[source]#

Bases: CheckHostnameMixin, ScriptMainTestCase

Test reflinks with run() removed.

These tests can’t verify the order of the pages in the XML as the constructor is given a preloading generator. See APISite.preloadpages for details.

abstract_class = False#
code = 'en'#
family = 'wikipedia'#
net = True#
setUp()[source]#

Set up the script by patching the bot class.

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

Tear down the test by undoing the bot class patch.

test_xml_multiple_namespace_ids()[source]#

Test the generator using multiple separate namespaces parameters.

test_xml_multiple_namespace_ids_2()[source]#

Test the generator using multiple namespaces in one parameter.

test_xml_namespace_name()[source]#

Test the generator using a namespace name.

test_xml_one_namespace()[source]#

Test the generator using one namespace id.

test_xml_simple()[source]#

Test the generator without any narrowing.

test_xml_start_variants()[source]#

Test the generator using variants of start page.

class tests.reflinks_tests.TestXMLPageGenerator(*args, **kwargs)[source]#

Bases: DisconnectedSiteMixin, TestCase

Test XML Page generator.

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

Test namespaces with namespace names.

test_non_bare_ref_urls()[source]#

Test pages without bare references are not processed.

test_simple_bare_refs()[source]#

Test simple bare references with several namespaces options.

test_start_variants()[source]#

Test with several page title options.

tests.reflinks_tests.dummy_constructor(self, *args, **kwargs)[source]#

A constructor faking the actual constructor.

Next
tests.replacebot_tests module
Previous
tests.redirect_bot_tests module
Copyright © (C) Pywikibot team, 2003-2023
Made with Sphinx and @pradyunsg's Furo
On this page
  • tests.reflinks_tests module
    • TestReferencesBotConstructor
      • abstract_class
      • code
      • family
      • net
      • setUp()
      • site
      • sites
      • tearDown()
      • test_xml_multiple_namespace_ids()
      • test_xml_multiple_namespace_ids_2()
      • test_xml_namespace_name()
      • test_xml_one_namespace()
      • test_xml_simple()
      • test_xml_start_variants()
    • TestXMLPageGenerator
      • abstract_class
      • code
      • dry
      • family
      • site
      • sites
      • test_namespace_names()
      • test_non_bare_ref_urls()
      • test_simple_bare_refs()
      • test_start_variants()
    • dummy_constructor()