Merge pull request #81 from eReuse/bugfix/74-json-backup-time-in-name
Bugfix/74 json backup time in name
This commit is contained in:
commit
f7f7432c4e
|
@ -32,7 +32,7 @@ def save_json(req_json, tmp_snapshots, user):
|
||||||
month = now.month
|
month = now.month
|
||||||
day = now.day
|
day = now.day
|
||||||
hour = now.hour
|
hour = now.hour
|
||||||
minutes = now.min
|
minutes = now.minute
|
||||||
|
|
||||||
name_file = f"{year}-{month}-{day}-{hour}-{minutes}_{user}_{uuid}.json"
|
name_file = f"{year}-{month}-{day}-{hour}-{minutes}_{user}_{uuid}.json"
|
||||||
path_name = os.path.join(tmp_snapshots, name_file)
|
path_name = os.path.join(tmp_snapshots, name_file)
|
||||||
|
|
|
@ -528,6 +528,7 @@ def test_save_snapshot_in_file(app: Devicehub, user: UserClient):
|
||||||
snapshot = {'software': '', 'version': '', 'uuid': ''}
|
snapshot = {'software': '', 'version': '', 'uuid': ''}
|
||||||
if files:
|
if files:
|
||||||
path_snapshot = os.path.join(tmp_snapshots, files[0])
|
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:
|
with open(path_snapshot) as file_snapshot:
|
||||||
snapshot = json.loads(file_snapshot.read())
|
snapshot = json.loads(file_snapshot.read())
|
||||||
|
|
||||||
|
|
Reference in a new issue