bec_lib.tests.utils.DMClientMock#

class DMClientMock(service: BECService, status_cb: list = None)[source]#

Bases: DeviceManagerBase

Methods

check_request_validity

Check if the config request is valid.

get_device

initialize

Initialize the DeviceManager by starting all connectors.

parse_config_message

Parse a config message and update the device config accordingly.

shutdown

Shutdown all connectors.

update_status

Update the status of the device manager :param status: New status :type status: BECStatus

Attributes

config_helper

devices

producer

check_request_validity(msg: DeviceConfigMessage) None#

Check if the config request is valid.

Parameters:

msg (DeviceConfigMessage) – Config message

initialize(bootstrap_server) None#

Initialize the DeviceManager by starting all connectors. :param bootstrap_server: Redis server address, e.g. ‘localhost:6379’

Returns:

parse_config_message(msg: DeviceConfigMessage) None#

Parse a config message and update the device config accordingly.

Parameters:

msg (DeviceConfigMessage) – Config message

shutdown()#

Shutdown all connectors.

update_status(status: BECStatus)#

Update the status of the device manager :param status: New status :type status: BECStatus