From 954dfa95a1ef8659fcf1a797d13b0f920196f0a2 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 29 Oct 2020 11:59:53 +0100 Subject: [PATCH 1/2] check in test this bug about time in the filename --- tests/test_snapshot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_snapshot.py b/tests/test_snapshot.py index 42792c2f..4348d408 100644 --- a/tests/test_snapshot.py +++ b/tests/test_snapshot.py @@ -493,6 +493,7 @@ def test_save_snapshot_in_file(app: Devicehub, user: UserClient): snapshot = {'software': '', 'version': '', 'uuid': ''} if files: path_snapshot = os.path.join(tmp_snapshots, files[0]) + assert not "0001-01-01 00:00:00" in path_snapshot with open(path_snapshot) as file_snapshot: snapshot = json.loads(file_snapshot.read()) From b2c258b69929fb12ce2a49a85fcfa0294307c0df Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 29 Oct 2020 12:10:12 +0100 Subject: [PATCH 2/2] fixed mark time correctly in the name file of json --- ereuse_devicehub/resources/action/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ereuse_devicehub/resources/action/views.py b/ereuse_devicehub/resources/action/views.py index 689cb942..de99781c 100644 --- a/ereuse_devicehub/resources/action/views.py +++ b/ereuse_devicehub/resources/action/views.py @@ -32,7 +32,7 @@ def save_json(req_json, tmp_snapshots, user): month = now.month day = now.day hour = now.hour - minutes = now.min + minutes = now.minute name_file = f"{year}-{month}-{day}-{hour}-{minutes}_{user}_{uuid}.json" path_name = os.path.join(tmp_snapshots, name_file)