示例#1
0
class PyCDLib(BaseIso9660):

    """
    PyCDLib-based check
    """

    @unittest.skipUnless(iso9660.has_pycdlib(), "pycdlib not installed")
    def setUp(self):
        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)
        new_iso.create()
        content = b"AVOCADO"
        for path in ("README", "/readme", "readme.txt", "quite-long-readme.txt"):
            new_iso.write(path, content)
            new_iso.close()
            read_iso = iso9660.ISO9660PyCDLib(new_iso_path)
            self.assertEqual(read_iso.read(path), content)
            self.assertTrue(os.path.isfile(new_iso_path))

    def test_mnt_dir(self):
        """Use the mnt_dir property"""
        self.mnt_dir_workflow()
示例#2
0
class PyCDLib(BaseIso9660):
    """
    PyCDLib-based check
    """
    @unittest.skipUnless(iso9660.has_pycdlib(), "pycdlib not installed")
    def setUp(self):
        super(PyCDLib, self).setUp()
        self.iso = iso9660.ISO9660PyCDLib(self.iso_path)

    def test_basic_workflow(self):
        """Call the basic workflow"""
        self.basic_workflow()
示例#3
0
class PyCDLib(BaseIso9660, unittest.TestCase):
    """
    PyCDLib-based check
    """
    @unittest.skipUnless(iso9660.has_pycdlib(), "pycdlib not installed")
    def setUp(self):
        super(PyCDLib, self).setUp()
        self.iso = iso9660.ISO9660PyCDLib(self.iso_path)

    def test_create_write(self):
        new_iso_path = os.path.join(self.tmpdir.name, 'new.iso')
        new_iso = iso9660.ISO9660PyCDLib(new_iso_path)
        new_iso.create()
        content = b"AVOCADO"
        for path in ("README", "/readme", "readme.txt",
                     "quite-long-readme.txt"):
            new_iso.write(path, content)
            new_iso.close()
            read_iso = iso9660.ISO9660PyCDLib(new_iso_path)
            self.assertEqual(read_iso.read(path), content)
            self.assertTrue(os.path.isfile(new_iso_path))