test_UFO3.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:otRebuilder 作者: Pal3love 项目源码 文件源码
def testRenameLayer(self):
        self.makeUFO()
        writer = UFOWriter(self.ufoPath)
        writer.renameGlyphSet("layer 1", "layer 3")
        writer.writeLayerContents(["public.default", "layer 3", "layer 2"])
        # directories
        path = os.path.join(self.ufoPath, "glyphs")
        exists = os.path.exists(path)
        self.assertEqual(True, exists)
        path = os.path.join(self.ufoPath, "glyphs.layer 1")
        exists = os.path.exists(path)
        self.assertEqual(False, exists)
        path = os.path.join(self.ufoPath, "glyphs.layer 2")
        exists = os.path.exists(path)
        self.assertEqual(True, exists)
        path = os.path.join(self.ufoPath, "glyphs.layer 3")
        exists = os.path.exists(path)
        self.assertEqual(True, exists)
        # layer contents
        path = os.path.join(self.ufoPath, "layercontents.plist")
        with open(path, "rb") as f:
            result = readPlist(f)
        expected = [['public.default', 'glyphs'], ['layer 3', 'glyphs.layer 3'], ['layer 2', 'glyphs.layer 2']]
        self.assertEqual(expected, result)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号