From 5435d21828a45182e585d9bb4d200784036a31e2 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 24 Jun 2022 15:23:24 +0200 Subject: [PATCH] add test for download snapshot --- CHANGELOG.md | 1 + tests/test_render_2_0.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bae2b54e..3193c889 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ml). ## testing - [add] #305 add button download iso Workbench. +- [add] #306 add link for download json snapshot - [changed] #302 add system uuid for check the identity of one device. ## [2.2.0] - 2022-06-24 diff --git a/tests/test_render_2_0.py b/tests/test_render_2_0.py index 94aa9d7f..d300249c 100644 --- a/tests/test_render_2_0.py +++ b/tests/test_render_2_0.py @@ -1385,3 +1385,18 @@ def test_export_lots(user3: UserClientFlask): assert fixture_csv[0] == export_csv[0], 'Headers are not equal' assert fixture_csv[1][1:] == export_csv[1][1:], 'Computer information are not equal' UUID(export_csv[1][0]) + + +@pytest.mark.mvp +@pytest.mark.usefixtures(conftest.app_context.__name__) +def test_export_snapshot_json(user3: UserClientFlask): + file_name = 'real-eee-1001pxd.snapshot.12.json' + snap = create_device(user3, file_name) + + snapshot = conftest.yaml2json(file_name.split(".json")[0]) + snapshot = json.dumps(snapshot) + + uri = "/inventory/export/snapshot/?id={}".format(snap.uuid) + body, status = user3.get(uri) + assert status == '200 OK' + assert body == snapshot