diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py index 390dd45b..4f160583 100644 --- a/ereuse_devicehub/resources/action/models.py +++ b/ereuse_devicehub/resources/action/models.py @@ -1321,6 +1321,7 @@ class Live(JoinedWithOneDeviceMixin, ActionWithOneDevice): @property def usage_time_allocate(self): """Show how many hours is used one device from the last check""" + import pdb; pdb.set_trace() self.sort_actions() if self.usage_time_hdd is None: return self.last_usage_time_allocate() @@ -1350,7 +1351,6 @@ class Live(JoinedWithOneDeviceMixin, ActionWithOneDevice): return timedelta(0) def diff_time(self): - import pdb; pdb.set_trace() for e in self.actions: if e.created > self.created: continue diff --git a/ereuse_devicehub/resources/action/views.py b/ereuse_devicehub/resources/action/views.py index ceecf6fe..287f91ec 100644 --- a/ereuse_devicehub/resources/action/views.py +++ b/ereuse_devicehub/resources/action/views.py @@ -121,6 +121,7 @@ class LiveView(View): """We get the liftime and serial_number of the disk""" usage_time_hdd = None serial_number = None + import pdb; pdb.set_trace() for hd in snapshot['components']: if not isinstance(hd, DataStorage): continue @@ -174,6 +175,7 @@ class LiveView(View): if not device.allocated: raise ValidationError('Sorry this device is not allocated.') + import pdb; pdb.set_trace() usage_time_hdd, serial_number = self.get_hdd_details(snapshot, device) data_live = {'usage_time_hdd': usage_time_hdd, diff --git a/tests/test_action.py b/tests/test_action.py index 3fbfba3e..34b42670 100644 --- a/tests/test_action.py +++ b/tests/test_action.py @@ -454,12 +454,13 @@ def test_live_search_last_allocate(user: UserClient, app: Devicehub): hdd_action['lifetime'] += 1000 acer.pop('elapsed') acer['licence_version'] = '1.0.0' + import pdb; pdb.set_trace() live, _ = user.post(acer, res=models.Live) acer['uuid'] = "490fb8c0-81a1-42e9-95e0-5e7db7038ec4" actions = [a for a in acer['components'][7]['actions'] if a['type'] != 'TestDataStorage'] acer['components'][7]['actions'] = actions - live, _ = user.post(acer, res=models.Live) import pdb; pdb.set_trace() + live, _ = user.post(acer, res=models.Live) assert live['usageTimeAllocate'] == 1000