tests.login_tests module#

Tests for LoginManager classes.

e.g. used to test password-file based login.

class tests.login_tests.FakeConfig[source]#

Bases: object

Mock.

usernames = {'~FakeFamily': {'~FakeCode': '~FakeUsername'}}#
class tests.login_tests.FakeFamily[source]#

Bases: object

Mock.

name = '~FakeFamily'#
class tests.login_tests.FakeSite[source]#

Bases: object

Mock.

code = '~FakeCode'#
family#

alias of FakeFamily

class tests.login_tests.TestOfflineLoginManager(*args, **kwargs)[source]#

Bases: DisconnectedSiteMixin, DefaultDrySiteTestCase

Test offline operation of login.LoginManager.

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

Test initialization of LoginManager without parameters.

test_star_family()[source]#

Test LoginManager with ‘*’ as family.

class tests.login_tests.TestPasswordFile(*args, **kwargs)[source]#

Bases: DisconnectedSiteMixin, DefaultDrySiteTestCase

Test parsing password files.

abstract_class = False#
code = 'test'#
dry = True#
family = 'wikipedia'#
patch(name)[source]#

Patch up <name> in self.setUp.

setUp()[source]#

Patch a variety of dependencies.

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

Test BotPassword entries.

When a BotPassword is used, the login_name changes to contain a suffix, while the password is read from an object (instead of being read from the password file directly).

test_auto_chmod_OK()[source]#

Do not chmod files that have mode private_files_permission.

test_auto_chmod_not_OK()[source]#

Chmod files that do not have mode private_files_permission.

test_match_code_username()[source]#

Test matching by full configuration.

test_match_family_username()[source]#

Test matching by family.

test_match_global_username()[source]#

Test global username/password declaration.

test_none_matching()[source]#

No matching passwords.

test_ordering()[source]#

Test that the last matching password is selected.