def vol(self, request): with fake_volume("file", size=MB, format=request.param) as vol: yield vol
def vol(self): with fake_volume('file') as vol: yield vol
def test_prepare_illegal_volume_allowed(self): with fake_volume('file', legal=False) as vol: vol.prepare(allow_illegal=True) assert vol.getMetaParam(sc.LEGALITY) == sc.ILLEGAL_VOL
def test_prepare_illegal_volume_fails(self): with fake_volume('file', legal=False) as vol: with pytest.raises(se.prepareIllegalVolumeError): vol.prepare()