BaseRealSensorMockTestCase#

class lsst.ts.ess.controller.BaseRealSensorMockTestCase(methodName='runTest')#

Bases: IsolatedAsyncioTestCase

Test Case for mocking real hardware sensors.

Subclasses need to implement test methods that replace the read method of the sensor with the read method in this class and then call the wait_for_read_event method.

log#

The logger.

Type:

logging.Logger

num_channels#

The number of channels of the sensor.

Type:

int

sensor#

The sensor.

Type:

common.sensor.TemperatureSensor

return_as_plain_text#

Is the output string expected to be plain text (True) or byte encoded (False).

Type:

bool

mtt#

Test tools for mock classes to ease testing the output of the sensor.

Type:

MockTestTools

Methods Summary

asyncSetUp()

wait_for_read_event([timeout])

Clear the read event and then wait for it to be set again.

Methods Documentation

async asyncSetUp()#
Return type:

None

async wait_for_read_event(timeout=5.0)#

Clear the read event and then wait for it to be set again.

It having been set again indicates new sensor data has been read.

Parameters:

timeout (float) – The timeout for reading the output.

Return type:

None