From cfe41e152bda39740940416e1fe193269ecc0ade Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 11 Apr 2022 11:25:09 +0200 Subject: [PATCH] test for errors of snapshot schemas --- tests/test_snapshot.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_snapshot.py b/tests/test_snapshot.py index 87756e25..6418ef1d 100644 --- a/tests/test_snapshot.py +++ b/tests/test_snapshot.py @@ -1116,3 +1116,14 @@ def test_snapshot_errors(user: UserClient): assert len(components11) == len(componentsLite) for c in components11: assert c in componentsLite + + +@pytest.mark.mvp +@pytest.mark.usefixtures(conftest.app_context.__name__) +def test_snapshot_errors_timestamp(user: UserClient): + """This test check the minimum validation of json that come from snapshot""" + snapshot_lite = file_json('snapshot-error-timestamp.json') + + bodyLite, res = user.post(snapshot_lite, uri="/api/inventory/") + assert res.status_code == 201 + assert len(SnapshotErrors.query.all()) == 1