From 0c1e5b8307313d1a9710af8124c384fc0449ad2c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 25 Nov 2020 18:42:36 +0100 Subject: [PATCH] changes from review --- ereuse_devicehub/resources/action/models.py | 3 +-- ereuse_devicehub/resources/action/views.py | 1 - ereuse_devicehub/resources/device/sync.py | 1 - tests/test_device.py | 2 +- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py index f1a6f182..bffd2a13 100644 --- a/ereuse_devicehub/resources/action/models.py +++ b/ereuse_devicehub/resources/action/models.py @@ -1510,8 +1510,7 @@ def update_components_action_one(target: ActionWithOneDevice, device: Device, __ target.components.clear() if isinstance(device, Computer): target.components |= device.components - else: - if isinstance(device, Computer): + elif isinstance(device, Computer): device.add_mac_to_hid() diff --git a/ereuse_devicehub/resources/action/views.py b/ereuse_devicehub/resources/action/views.py index 17fd07a0..3f21f0bf 100644 --- a/ereuse_devicehub/resources/action/views.py +++ b/ereuse_devicehub/resources/action/views.py @@ -100,7 +100,6 @@ class ActionView(View): action = Action.query.filter_by(id=id).one() return self.schema.jsonify(action) - def snapshot(self, snapshot_json: dict, resource_def): """Performs a Snapshot. diff --git a/ereuse_devicehub/resources/device/sync.py b/ereuse_devicehub/resources/device/sync.py index 32aa8843..5f13d5a0 100644 --- a/ereuse_devicehub/resources/device/sync.py +++ b/ereuse_devicehub/resources/device/sync.py @@ -52,7 +52,6 @@ class Sync: of the passed-in components. 2. A list of Add / Remove (not yet added to session). """ - db_device = self.execute_register(device) db_components, actions = OrderedSet(), OrderedSet() if components is not None: # We have component info (see above) diff --git a/tests/test_device.py b/tests/test_device.py index 8c68077c..b0dcd1d7 100644 --- a/tests/test_device.py +++ b/tests/test_device.py @@ -1,5 +1,5 @@ -import datetime import copy +import datetime import pytest from uuid import UUID