test_UFO3.py 文件源码

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

项目:otRebuilder 作者: Pal3love 项目源码 文件源码
def testInvalidLayerContentsFormat(self):
        # bogus
        self.makeUFO()
        path = os.path.join(self.ufoPath, "layercontents.plist")
        os.remove(path)
        with open(path, "w") as f:
            f.write("test")
        reader = UFOReader(self.ufoPath)
        self.assertRaises(UFOLibError, reader.getGlyphSet)
        # dict
        self.makeUFO()
        path = os.path.join(self.ufoPath, "layercontents.plist")
        os.remove(path)
        layerContents = {
            "public.default" : "glyphs",
            "layer 1" : "glyphs.layer 1",
            "layer 2" : "glyphs.layer 2",
        }
        with open(path, "wb") as f:
            writePlist(layerContents, f)
        reader = UFOReader(self.ufoPath)
        self.assertRaises(UFOLibError, reader.getGlyphSet)

    # layer contents invalid name format
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号