TestMocker

class tests.general.test_mocker.TestMocker(methodName='runTest')[source]
__init__(methodName='runTest')

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

Methods

Methods

test_mocker_add_modules()

test_mocker_attributes()

Set an attribute on a Mocker instance and confirm we can retrieve it again

test_mocker_items()

Set an item on a Mocker instance and confirm we can retrieve it again

test_mocker_items_attributes_equiv()

Set an attribute and item on a Mocker instance and confirm both can be accessed as items or attributes

test_mocker_make_class()

Create a “disguised” Mocker class and confirm the class name is correct

test_mocker_make_class_module()

Create a “disguised” Mocker class with a custom module and confirm the class name + module is correct

test_mocker_make_class_module_isolation()

Create two “disguised” mocker classes and confirm both instances have independent class names/modules

test_mocker_make_class_not_instance()

Create a “disguised” Mocker class with instance=False and confirm it’s a class, not an instance

Attributes

Attributes