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
评论列表
文章目录