From f3e8fa6cc17549906f0b36a2d0e8f24a36d4fd0f Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 29 Mar 2022 11:24:54 +0200 Subject: [PATCH] add action data storage test --- tests/test_snapshot.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_snapshot.py b/tests/test_snapshot.py index 62c4b9b9..6d223316 100644 --- a/tests/test_snapshot.py +++ b/tests/test_snapshot.py @@ -1028,17 +1028,19 @@ def test_min_validate_fields(user: UserClient): @pytest.mark.mvp +@pytest.mark.usefixtures(conftest.app_context.__name__) def test_snapshot_wb_lite(user: UserClient): """This test check the minimum validation of json that come from snapshot""" - # import pdb; pdb.set_trace() snapshot = file_json("example_wb14_x1.json") body, res = user.post(snapshot, res=Snapshot) - # a = [x['type'] for x in body['components']] - ssd = [x for x in body['components'] if x['type'] == 'SolidStateDrive'][0] assert body['device']['manufacturer'] == 'lenovo' assert ssd['serialNumber'] == 's35anx0j' assert res.status == '201 CREATED' + assert '00:28:f8:a6:d5:7e' in body['device']['hid'] + + dev = m.Device.query.filter_by(id=body['device']['id']).one() + assert dev.actions[0].power_on_hours == 6013