def test_when_start_controller_then_wait_start_command(self): network_ctrl = MagicMock() ctrl = RobotController(MagicMock(), MagicMock(), network_ctrl, MagicMock()) ctrl._start() network_ctrl.wait_start_command.assert_called_once()
def test_when_start_controller_then_get_host_ip(self): network_scanner = MagicMock() ctrl = RobotController(MagicMock(), network_scanner, MagicMock(), MagicMock()) ctrl._start() network_scanner.get_host_ip.assert_called_once()
def test_given_host_ip_when_start_controller_then_pair_with_host(self): host_ip = '10.42.0.78' network_scanner = Mock() network_scanner.attach_mock(Mock(return_value=host_ip), 'get_host_ip') network_ctrl = MagicMock() ctrl = RobotController(MagicMock(), network_scanner, network_ctrl, MagicMock()) ctrl._start() network_ctrl.pair_with_host.assert_called_once_with(host_ip)