Raise proper error when you try to load an empty qcow2 file

Fix #637
This commit is contained in:
Julien Duponchelle committed 2016-08-29 10:18:18 +02:00
1 parent 1885fe62a6
commit 042a69eecf
2 files changed
+10 -1

No files matched your search

+6
View File
@@ -56,6 +56,12 @@ def test_invalid_file():
Qcow2("tests/resources/nvram_iou")
def test_invalid_empty_file(tmpdir):
open(str(tmpdir / 'a'), 'w+').close()
with pytest.raises(Qcow2Error):
Qcow2(str(tmpdir / 'a'))
@pytest.mark.skipif(qemu_img() is None, reason="qemu-img is not available")
def test_rebase(tmpdir, loop):
shutil.copy("tests/resources/empty8G.qcow2", str(tmpdir / "empty16G.qcow2"))