Example #1
0
 def test_capabilities(self):
     """
     Verify the FSM reports capabilities as expected.  All states defined in this dict must
     also be defined in the protocol FSM.
     """
     driver = InstrumentDriver(self._got_data_event_callback)
     self.assert_capabilities(driver, self._capabilities)
Example #2
0
 def test_driver_schema(self):
     """
     get the driver schema and verify it is configured properly
     """
     driver = InstrumentDriver(self._got_data_event_callback)
     self.assert_driver_schema(driver, self._driver_parameters,
                               self._driver_capabilities)
Example #3
0
 def test_connect(self, initial_protocol_state=ProtocolState.COMMAND):
     """
     Verify driver can transition to the COMMAND state
     @param initial_protocol_state Desired initial protocol state
     @returns driver
     """
     driver = InstrumentDriver(self._got_data_event_callback)
     self.assert_initialize_driver(driver, initial_protocol_state)
     log.debug('Adding Mock side effect to connection.send')
     driver._connection.send.side_effect = self.my_send(driver)
     driver._protocol.set_init_params(mcu_startup_config)
     driver._protocol._init_params()
     return driver