communication.communicators.mock_communicator module¶
This module contains a mock client and communicator for testing purposes.
- class communication.communicators.mock_communicator.MockCommunicator(identifier)[source]¶
Bases:
Communicator[MockConnection]A mock communicator for testing applications. All the pools must be able to reference each other’s communicators, i.e. be running in the same python process.
- class communication.communicators.mock_communicator.MockConnection(remote)[source]¶
Bases:
objectMock Connection.
Simply keeps a reference to the remote Communicator instance to be able to directly call its receive_handler.
- __init__(remote)[source]¶
Initialise the mock client.
Each client must have a reference to the communicator of that client. E.g. If party A adds party B to its pool, it must provide the communicator of Party B as input.
- Parameters:
remote (
MockCommunicator) – The communicator of that party.