Exemplo n.º 1
0
    def test_write_reboot_writeonly_prop__if_write_wrong_value__should_raise_error(
            self, value):
        sdk = Mock()
        sdk.set_device_param.return_value = None
        obj = DeviceParameters(sdk, ZK400)

        with pytest.raises(TypeError):
            obj.reboot = value
Exemplo n.º 2
0
    def test_write_reboot_writeonly_prop__if_write_1__should_set_value_on_a_device(
            self):
        sdk = Mock()
        sdk.set_device_param.return_value = None
        obj = DeviceParameters(sdk, ZK400)

        obj.reboot = True

        sdk.set_device_param.assert_called_once_with(
            parameters={'Reboot': '1'})