test for errors of snapshot schemas

This commit is contained in:
Cayo Puigdefabregas 2022-04-11 11:25:09 +02:00
parent e696f9b1af
commit cfe41e152b
1 changed files with 11 additions and 0 deletions

View File

@ -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