1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 09:18:08 +00:00

Fix IOU test run on Windows

This commit is contained in:
Julien Duponchelle 2017-04-18 16:21:45 +02:00
parent 54014ccd39
commit c72ae1bfe7
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import os import os
import sys
from unittest.mock import patch from unittest.mock import patch
@ -105,9 +106,10 @@ def test_list_images(tmpdir):
path = tmpdir / "images2" / "test_invalid.image" path = tmpdir / "images2" / "test_invalid.image"
path.write(b'NOTANELF', ensure=True) path.write(b'NOTANELF', ensure=True)
path3 = tmpdir / "images1" / "IOU" / "test3.bin" if sys.platform.startswith("linux"):
path3.write(b'\x7fELF\x01\x02\x01', ensure=True) path3 = tmpdir / "images1" / "IOU" / "test3.bin"
path3 = force_unix_path(str(path3)) path3.write(b'\x7fELF\x01\x02\x01', ensure=True)
path3 = force_unix_path(str(path3))
path4 = tmpdir / "images1" / "QEMU" / "test4.qcow2" path4 = tmpdir / "images1" / "QEMU" / "test4.qcow2"
path4.write("1", ensure=True) path4.write("1", ensure=True)
@ -137,14 +139,15 @@ def test_list_images(tmpdir):
} }
] ]
assert list_images("iou") == [ if sys.platform.startswith("linux"):
{ assert list_images("iou") == [
'filename': 'test3.bin', {
'filesize': 7, 'filename': 'test3.bin',
'md5sum': 'b0d5aa897d937aced5a6b1046e8f7e2e', 'filesize': 7,
'path': 'test3.bin' 'md5sum': 'b0d5aa897d937aced5a6b1046e8f7e2e',
} 'path': 'test3.bin'
] }
]
assert list_images("qemu") == [ assert list_images("qemu") == [
{ {