[kemonoparty] fix deleting 'name' in orginal objects (#5103)

... when computing 'revision_hash'

regression caused by 3d68eda4

dict.copy() only creates a shallow copy
I know that and still managed to get I wrong ...
This commit is contained in:
Mike Fährmann
2024-01-25 20:30:37 +01:00
parent beacfa7436
commit c28475d325
2 changed files with 22 additions and 3 deletions

View File

@@ -175,9 +175,26 @@ __tests__ = (
"#class" : kemonoparty.KemonopartyPostExtractor,
"#urls" : "https://kemono.su/data/88/52/88521f71822dfa2f42df3beba319ea4fceda2a2d6dc59da0276a75238f743f86.jpg",
"revision_id": 142470,
"file" : {
"hash": "88521f71822dfa2f42df3beba319ea4fceda2a2d6dc59da0276a75238f743f86",
"name": "wip update.jpg",
"path": "/88/52/88521f71822dfa2f42df3beba319ea4fceda2a2d6dc59da0276a75238f743f86.jpg",
"type": "file",
},
"attachments": [
{
"hash": "88521f71822dfa2f42df3beba319ea4fceda2a2d6dc59da0276a75238f743f86",
"name": "wip update.jpg",
"path": "/88/52/88521f71822dfa2f42df3beba319ea4fceda2a2d6dc59da0276a75238f743f86.jpg",
"type": "attachment",
},
],
"filename" : "wip update",
"extension" : "jpg",
"hash" : "88521f71822dfa2f42df3beba319ea4fceda2a2d6dc59da0276a75238f743f86",
"revision_id" : 142470,
"revision_index": 2,
"revision_hash": "e0e93281495e151b11636c156e52bfe9234c2a40",
"revision_hash" : "e0e93281495e151b11636c156e52bfe9234c2a40",
},
{
@@ -191,7 +208,7 @@ __tests__ = (
"revision_id": range(134996, 3052965),
"revision_index": range(1, 9),
"revision_hash": r"re:^[0-9a-f]{40}$",
"revision_hash": "e0e93281495e151b11636c156e52bfe9234c2a40",
},