提交 4f1c28a8 编写于 作者: C Cleber Rosa

ISO9660 selftests: make basic_workflow into a test method

As per the last change, let's move the test into the base class, and
just check if the ISO has been setup for this test to work with, and
if not, skip it.  This removes a lot of the boiler plate code.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 a57696d5
......@@ -58,13 +58,12 @@ class BaseIso9660(unittest.TestCase):
self.iso = None
self.tmpdir = tempfile.mkdtemp(prefix="avocado_" + __name__)
def basic_workflow(self):
def test_basic_workflow(self):
"""
Check the basic Iso9660 workflow
:warning: Make sure to include this in per-implementation tests
due to ast loader we can't just define a base-class.
"""
if self.iso is None:
self.skipTest("ISO attribute not setup for this test to work with")
self.assertEqual(self.iso.read("file"),
b"file content\n")
dst = os.path.join(self.tmpdir, "file")
......@@ -111,10 +110,6 @@ class IsoInfo(BaseIso9660):
super(IsoInfo, self).setUp()
self.iso = iso9660.Iso9660IsoInfo(self.iso_path)
def test_basic_workflow(self):
"""Call the basic workflow"""
self.basic_workflow()
class IsoRead(BaseIso9660):
......@@ -128,10 +123,6 @@ class IsoRead(BaseIso9660):
super(IsoRead, self).setUp()
self.iso = iso9660.Iso9660IsoRead(self.iso_path)
def test_basic_workflow(self):
"""Call the basic workflow"""
self.basic_workflow()
class IsoMount(BaseIso9660):
......@@ -145,10 +136,6 @@ class IsoMount(BaseIso9660):
super(IsoMount, self).setUp()
self.iso = iso9660.Iso9660Mount(self.iso_path)
def test_basic_workflow(self):
"""Call the basic workflow"""
self.basic_workflow()
class PyCDLib(BaseIso9660):
......@@ -161,10 +148,6 @@ class PyCDLib(BaseIso9660):
super(PyCDLib, self).setUp()
self.iso = iso9660.ISO9660PyCDLib(self.iso_path)
def test_basic_workflow(self):
"""Call the basic workflow"""
self.basic_workflow()
def test_create_write(self):
new_iso_path = os.path.join(self.tmpdir, 'new.iso')
new_iso = iso9660.ISO9660PyCDLib(new_iso_path)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册