tests.bot_tests module#
Bot tests.
- class tests.bot_tests.LiveBotTestCase(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,TestBotTreatExit
,DefaultSiteTestCase
Test bot classes which need to check the Page object live.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.bot_tests.Options(**kwargs)[source]#
Bases:
OptionHandler
A derived OptionHandler class.
Only accept options defined in available_options.
- Parameters:
kwargs (Any) – bot options
- available_options: Dict[str, Any] = {'bar': 42, 'baz': False, 'foo': 'bar'}#
Handler configuration attribute. Only the keys of the dict can be passed as
__init__
options. The values are the default values. Overwrite this in subclasses!
- class tests.bot_tests.TWNBotTestCase(*args, **kwargs)[source]#
Bases:
TestCase
Verify that i18n is available.
- abstract_class = True#
- class tests.bot_tests.TestBotTreatExit[source]#
Bases:
object
Mixin to provide handling for treat and exit.
- class tests.bot_tests.TestDrySiteBot(*args, **kwargs)[source]#
Bases:
DisconnectedSiteMixin
,TestBotTreatExit
,SiteAttributeTestCase
Tests for the BaseBot subclasses.
- CANT_SET_ATTRIBUTE_RE = "can't set attribute"#
- NOT_IN_TREAT_RE = 'Requesting the site not while in treat is not allowed.'#
- abstract_class = False#
- dry = True#
- site = True#
- sites = {'de': {'code': 'de', 'family': 'wikipedia'}, 'en': {'code': 'en', 'family': 'wikipedia'}}#