mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Do not use the md5 from cache for a missing image
This commit is contained in:
1 parent
4aadfa3b67
commit
a8e69d9a0b
2 files changed
+25
-9
No files matched your search
@@ -34,12 +34,24 @@ def test_md5sum(tmpdir):
|
||||
def test_md5sum_existing_digest(tmpdir):
|
||||
fake_img = str(tmpdir / 'hello')
|
||||
|
||||
with open(fake_img, 'w+') as f:
|
||||
f.write('hello')
|
||||
|
||||
with open(str(tmpdir / 'hello.md5sum'), 'w+') as f:
|
||||
f.write('aaaaa02abc4b2a76b9719d911017c592')
|
||||
|
||||
assert md5sum(fake_img) == 'aaaaa02abc4b2a76b9719d911017c592'
|
||||
|
||||
|
||||
def test_md5sum_existing_digest_but_missing_image(tmpdir):
|
||||
fake_img = str(tmpdir / 'hello')
|
||||
|
||||
with open(str(tmpdir / 'hello.md5sum'), 'w+') as f:
|
||||
f.write('aaaaa02abc4b2a76b9719d911017c592')
|
||||
|
||||
assert md5sum(fake_img) is None
|
||||
|
||||
|
||||
def test_md5sum_none(tmpdir):
|
||||
assert md5sum(None) is None
|
||||
|
||||
|
||||
Reference in new issue
Block a user