From 74f9b88ece7d81e64b3dd470f93491f3ffa70550 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 7 Jun 2022 15:06:18 +0200 Subject: [PATCH] preload SnapshotsLog in dummy --- ereuse_devicehub/dummy/dummy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/dummy/dummy.py b/ereuse_devicehub/dummy/dummy.py index 5b6ab47a..dbe96805 100644 --- a/ereuse_devicehub/dummy/dummy.py +++ b/ereuse_devicehub/dummy/dummy.py @@ -20,6 +20,7 @@ from ereuse_devicehub.resources.tag.model import Tag from ereuse_devicehub.resources.user import User from ereuse_devicehub.resources.user.models import Session from ereuse_devicehub.resources.enums import SessionType +from ereuse_devicehub.parser.models import SnapshotsLog class Dummy: @@ -65,6 +66,7 @@ class Dummy: erase=True, common=True) print('Creating stuff...'.ljust(30), end='') + assert SnapshotsLog.query.filter().all() == [] with click_spinner.spinner(): out = runner.invoke('org', 'add', *self.ORG).output org_id = json.loads(out)['id'] @@ -95,7 +97,8 @@ class Dummy: for path in bar: with path.open() as f: snapshot = yaml.load(f) - s, _ = user1.post(res=m.Snapshot, data=self.json_encode(snapshot)) + # s, _ = user1.post(res=m.Snapshot, data=self.json_encode(snapshot)) + s, _ = user1.post(res=m.Snapshot, data=snapshot) if s.get('uuid', None) == 'ec23c11b-80b6-42cd-ac5c-73ba7acddbc4': sample_pc = s['device']['id'] sample_pc_devicehub_id = s['device']['devicehubID']