Graphics protocol: Fix delete by number not deleting newest image with the specified number

Fixes #8071
This commit is contained in:
Kovid Goyal
2024-11-24 10:11:34 +05:30
parent 0eaf44d33d
commit cb2e1fcd04
3 changed files with 25 additions and 13 deletions

View File

@@ -582,6 +582,16 @@ class TestGraphics(BaseTest):
self.ae(s.grman.image_count, count - 1)
delete(I=1)
self.ae(s.grman.image_count, count - 2)
cn = 1117
li('abc', s=1, v=1, f=24, I=cn)
first_id = g.image_for_client_number(cn)['internal_id']
li('abc', s=1, v=1, f=24, I=cn)
second_id = g.image_for_client_number(cn)['internal_id']
self.assertNotEqual(first_id, second_id)
count = s.grman.image_count
delete(I=cn)
self.ae(g.image_for_client_number(cn)['internal_id'], first_id)
self.ae(s.grman.image_count, count - 1)
s.reset()
self.assertEqual(g.disk_cache.total_size, 0)