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