From 7c0b3c190c0acd6c2ae1ec00e0318c878a7f80c0 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 19 Apr 2022 10:47:49 +0200 Subject: [PATCH] test for check general snapshots --- ereuse_devicehub/parser/parser.py | 1 - tests/test_snapshot.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/parser/parser.py b/ereuse_devicehub/parser/parser.py index cac097af..2394628f 100644 --- a/ereuse_devicehub/parser/parser.py +++ b/ereuse_devicehub/parser/parser.py @@ -464,7 +464,6 @@ class ParseSnapshotLsHw: def get_data_storage(self): - # import pdb; pdb.set_trace() for sm in self.smart: if sm.get('smartctl', {}).get('exit_status') == 1: continue diff --git a/tests/test_snapshot.py b/tests/test_snapshot.py index f3a6c3e7..1ea2d933 100644 --- a/tests/test_snapshot.py +++ b/tests/test_snapshot.py @@ -1155,3 +1155,17 @@ def test_snapshot_errors_no_serial_number(user: UserClient): assert not c.manufacturer test = c.actions[-1] assert test.power_on_hours == 19819 + + +@pytest.mark.usefixtures(conftest.app_context.__name__) +def test_snapshot_check_tests_lite(user: UserClient): + """This test check the minimum validation of json that come from snapshot""" + snapshot_lite = file_json('test_lite/2022-4-13-19-5_user@dhub.com_b27dbf43-b88a-4505-ae27-10de5a95919e.json') + + bodyLite, res = user.post(snapshot_lite, uri="/api/inventory/") + assert res.status_code == 201 + SnapshotErrors.query.all() + dev = m.Device.query.filter_by(id=bodyLite['device']['id']).one() + # import pdb; pdb.set_trace() + +