From 79b4c738e9b633d88c830c342fcfb5b3e7f2b10c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 15 Oct 2020 11:00:11 +0200 Subject: [PATCH] change the name of the file --- ereuse_devicehub/resources/action/views.py | 4 +++- tests/test_snapshot.py | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/resources/action/views.py b/ereuse_devicehub/resources/action/views.py index bbd1a89f..689cb942 100644 --- a/ereuse_devicehub/resources/action/views.py +++ b/ereuse_devicehub/resources/action/views.py @@ -31,8 +31,10 @@ def save_json(req_json, tmp_snapshots, user): year = now.year month = now.month day = now.day + hour = now.hour + minutes = now.min - name_file = f"{uuid}_{user}_{year}-{month}-{day}.json" + name_file = f"{year}-{month}-{day}-{hour}-{minutes}_{user}_{uuid}.json" path_name = os.path.join(tmp_snapshots, name_file) if not os.path.isdir(tmp_snapshots): diff --git a/tests/test_snapshot.py b/tests/test_snapshot.py index 94f9f3e2..42792c2f 100644 --- a/tests/test_snapshot.py +++ b/tests/test_snapshot.py @@ -583,7 +583,6 @@ def test_snapshot_failed_null_chassis(app: Devicehub, user: UserClient): uuid = snapshot_error['uuid'] snapshot = {'software': '', 'version': '', 'uuid': ''} - # import pdb; pdb.set_trace() with pytest.raises(TypeError): user.post(res=Snapshot, data=snapshot_error)