@@ -0,0 +1,2649 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import absolute_import, unicode_literals%0Afrom fontTools.misc.py23 import tostr%0Afrom ufoLib import UFOReader, UFOWriter, UFOFileStructure%0Afrom ufoLib.errors import UFOLibError, GlifLibError%0Afrom ufoLib import plistlib%0Aimport sys%0Aimport os%0Aimport fs.osfs%0Aimport fs.tempfs%0Aimport fs.memoryfs%0Aimport fs.copy%0Aimport pytest%0Aimport warnings%0A%0A%0ATESTDATA = fs.osfs.OSFS(%0A    os.path.join(os.path.dirname(__file__), %22testdata%22)%0A)%0ATEST_UFO3 = %22TestFont1 (UFO3).ufo%22%0ATEST_UFOZ = %22TestFont1 (UFO3).ufoz%22%0A%0A%0A@pytest.fixture(params=%5BTEST_UFO3, TEST_UFOZ%5D)%0Adef testufo(request):%0A    name = request.param%0A    with fs.tempfs.TempFS() as tmp:%0A        if TESTDATA.isdir(name):%0A            fs.copy.copy_dir(TESTDATA, name, tmp, name)%0A        else:%0A            fs.copy.copy_file(TESTDATA, name, tmp, name)%0A        yield tmp.getsyspath(name)%0A%0A%0A@pytest.fixture%0Adef testufoz():%0A    with fs.tempfs.TempFS() as tmp:%0A        fs.copy.copy_file(TESTDATA, TEST_UFOZ, tmp, TEST_UFOZ)%0A        yield tmp.getsyspath(TEST_UFOZ)%0A%0A%0Aclass TestUFOZ(object):%0A%0A    def test_read(self, testufoz):%0A        with UFOReader(testufoz) as reader:%0A            assert reader.fileStructure == UFOFileStructure.ZIP%0A            assert reader.formatVersion == 3%0A%0A    def test_write(self, testufoz):%0A        with UFOWriter(testufoz, structure=%22zip%22) as writer:%0A            writer.writeLib(%7B%22hello world%22: 123%7D)%0A        with UFOReader(testufoz) as reader:%0A            assert reader.readLib() == %7B%22hello world%22: 123%7D%0A%0A%0Adef test_pathlike(testufo):%0A%0A    class PathLike(object):%0A%0A        def __init__(self, s):%0A            self._path = s%0A%0A        def __fspath__(self):%0A            return tostr(self._path, sys.getfilesystemencoding())%0A%0A    path = PathLike(testufo)%0A%0A    with UFOReader(path) as reader:%0A        assert reader._path == path.__fspath__()%0A%0A    with UFOWriter(path) as writer:%0A        assert writer._path == path.__fspath__()%0A%0A%0Adef test_path_attribute_deprecated(testufo):%0A    with UFOWriter(testufo) as writer:%0A        with pytest.warns(DeprecationWarning, match=%22The 'path' attribute%22):%0A            writer.path%0A%0A%0A@pytest.fixture%0Adef memufo():%0A    m = fs.memoryfs.MemoryFS()%0A    fs.copy.copy_dir(TESTDATA, TEST_UFO3, m, %22/%22)%0A    return m%0A%0A%0Aclass TestMemoryFS(object):%0A%0A    def test_init_reader(self, memufo):%0A        with UFOReader(memufo) as reader:%0A            assert reader.formatVersion == 3%0A            assert reader.fileStructure == UFOFileStructure.PACKAGE%0A%0A    def test_init_writer(self):%0A        m = fs.memoryfs.MemoryFS()%0A        with UFOWriter(m) as writer:%0A            assert m.exists(%22metainfo.plist%22)%0A            assert writer._path == %22%3Cmemfs%3E%22%0A

Add tests/test_UFOZ.py