Пример #1
0
    def test_init(self, adb_connect):
        name = 'fake_device'
        device_id = 123456789
        device_settings = {
            'root_disable_charging': True,
            'charging_disabled_value': '0',
            'usb_charging_disabled_file': 'test/file',
            'power_device': {
                'script_path': 'fake/path',
                'py_path': 'python',
                'vout': '3',
                'serial_num': '23'
            },
            'device_settings_reqs': {
                'app1': ['a, b'],
                'app2': ['c']
            }
        }

        device = Device(name, device_id, device_settings)

        assert device.name == name
        assert device.id == device_id
        assert device.root_plug_value is None
        assert device.root_unplug_file == 'test/file'
        assert device.root_unplug_value == '0'
        assert device.root_unplug is True
        assert device.power_device is not None
        assert device.power_device['script_path'] == 'fake/path'
        assert device.power_device['py_path'] == 'python'
        assert device.device_settings_reqs == {'app1': ['a, b'], 'app2': ['c']}
        adb_connect.assert_called_once_with(device_id)
Пример #2
0
    def device(self, adb_connect):
        adb_connect.return_value = None
        name = 'fake_device'
        device_id = 123456789
        device_settings = {}

        return Device(name, device_id, device_settings)
Пример #3
0
    def device_root(self, adb_connect):
        adb_connect.return_value = None
        name = 'fake_device'
        device_id = 123456789
        device_settings = {
            'root_disable_charging': True,
            'charging_disabled_value': '0',
            'usb_charging_disabled_file': 'test/file'
        }

        return Device(name, device_id, device_settings)
Пример #4
0
    def device_with_app_settings(self, adb_connect):
        adb_connect.return_value = None
        name = 'fake_device'
        device_id = 123456789
        device_settings = {
            "device_settings_reqs": {
                "app1": ["setting_1"],
                "app2": ["setting_1", "setting_2"]
            }
        }

        return Device(name, device_id, device_settings)