Exemplo n.º 1
0
    def test_incomplete_robot(self, caplog):
        # we now allow creating robots with no buses
        caplog.clear()
        _ = BaseRobot.from_yaml('tests/no_buses.yml')

        # we now allow creating robots with no devices
        caplog.clear()
        _ = BaseRobot.from_yaml('tests/no_devices.yml')

        caplog.clear()
        _ = BaseRobot.from_yaml('tests/dummy_robot.yml')
        assert 'Only the first robot will be considered' in caplog.text
Exemplo n.º 2
0
 def test_robot_from_yaml(self, mock_robot):
     mock_robot.stop()       # to avoid conflicts on the bus
     new_robot = BaseRobot.from_yaml('tests/dummy_robot.yml')
     new_robot.start()
     new_robot.syncs['write'].start()
     time.sleep(2)           # for loops to run
     new_robot.stop()
     mock_robot.start()      # restart for other cases
     assert mock_robot.name == 'dummy'
Exemplo n.º 3
0
 def mock_robot(self):   
     robot = BaseRobot.from_yaml('tests/dummy_robot.yml')
     robot.start()
     yield robot
     robot.stop()
Exemplo n.º 4
0
 def mh2_robot(self):
     robot = BaseRobot.from_yaml('tests/MH2_robot.yml')
     robot.start()
     yield robot
     robot.stop()