Exemplo n.º 1
0
    def run_ufolib_import_validation(self):
        """
        ufoLib GlyphSet.readLayerInfo method performs validations of layerinfo.plist file(s)
        :return: (list) list of test failure Result objects
        """
        ss = StdStreamer(self.ufopath)
        for glyphs_dir in self.ufoobj.glyphsdir_list:
            res = Result(glyphs_dir[1])
            rel_dir_path = os.path.join(self.ufopath, glyphs_dir[1])

            try:
                gs = GlyphSet(rel_dir_path, ufoFormatVersion=self.ufoversion)
                gs.readLayerInfo(self.layerinfo_obj)
                res.test_failed = False
                ss.stream_result(res)
            except Exception as e:
                res.test_failed = True
                res.test_long_stdstream_string = "layerinfo.plist in " + rel_dir_path + " failed ufoLib import test with error: " + str(
                    e)
                self.test_fail_list.append(res)
                ss.stream_result(res)
        return self.test_fail_list