def setup_class(self):
        super().setup_class()

        if len(self.fuchsia_devices) < 2:
            raise signals.TestAbortAll("Need at least two Fuchsia devices")
        for device in self.fuchsia_devices:
            device.btc_lib.initBluetoothControl()
Exemplo n.º 2
0
def abort_all(reason, extras=None):
    """Abort all subsequent test cases, including the ones not in this test
    class or iteration.

    Args:
        reason: The reason to abort.
        extras: An optional field for extra information to be included in
                test result.

    Raises:
        signals.TestAbortAll is raised to abort all subsequent tests.
    """
    raise signals.TestAbortAll(reason, extras)
Exemplo n.º 3
0
def get_serial_object(pri_ad, serial_device):
    """This function will creates object for serial device connected.

    Args:
        pri_ad: Android device.
        serial_device: serial device connected.

    Returns:
        object of serial device, otherwise Abort the class.
    """
    devices = apollo_lib.get_devices()
    for device in devices:
        if device['serial_number'] in serial_device:
            return apollo_lib.BudsDevice(device['serial_number'])
    pri_ad.log.error('Apollo device not found')
    raise signals.TestAbortAll('Apollo device not found')