示例#1
0
 def test_manual_bus(self, caplog):
     rob = BaseRobot()
     bus = SharedFileBus(name='busA', port='/tmp/busA.log')
     rob.add_bus(bus)
     assert len(rob.buses) == 1
     bus.open()
     # re-add
     caplog.clear()
     rob.add_bus(bus)
     assert len(caplog.records) == 1
     assert len(rob.buses) == 1
示例#2
0
 def test_manual_device(self, caplog):
     rob = BaseRobot()
     bus = SharedFileBus(name='busA', port='/tmp/busA.log')
     rob.add_bus(bus)
     dev = BaseDevice(name='dev1', bus=bus, dev_id=42, model='DUMMY')
     rob.add_device(dev)
     assert len(rob.devices) == 1
     bus.open()
     # re-add
     caplog.clear()
     rob.add_device(dev)
     assert len(caplog.records) == 1
     assert len(rob.devices) == 1