From e50733df21e9b07ce2f4443814397699a55298f7 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Tue, 5 Feb 2019 14:33:58 +0000 Subject: [PATCH] Make simpler test in cffLib tests --- Tests/cffLib/cffLib_test.py | 17 +++++++++++++++++ Tests/varLib/interpolate_layout_test.py | 16 ---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Tests/cffLib/cffLib_test.py b/Tests/cffLib/cffLib_test.py index 1d169c9a6..ce73b3440 100644 --- a/Tests/cffLib/cffLib_test.py +++ b/Tests/cffLib/cffLib_test.py @@ -2,6 +2,8 @@ from __future__ import print_function, division, absolute_import from fontTools.cffLib import TopDict, PrivateDict, CharStrings from fontTools.misc.testTools import parseXML, DataFilesHandler from fontTools.ttLib import TTFont +import copy +import os import sys import unittest @@ -59,6 +61,21 @@ class CffLibTest(DataFilesHandler): topDict2 = font2["CFF "].cff.topDictIndex[0] self.assertEqual(topDict2.Encoding[32], "space") + def test_CFF_deepcopy(self): + """Test that deepcopying a TTFont with a CFF table does not recurse + infinitely.""" + ttx_path = os.path.join( + os.path.dirname(__file__), + "..", + "varLib", + "data", + "master_ttx_interpolatable_otf", + "TestFamily2-Master0.ttx", + ) + font = TTFont(recalcBBoxes=False, recalcTimestamp=False) + font.importXML(ttx_path) + copy.deepcopy(font) + if __name__ == "__main__": sys.exit(unittest.main()) diff --git a/Tests/varLib/interpolate_layout_test.py b/Tests/varLib/interpolate_layout_test.py index dacd640c4..b858a3c97 100644 --- a/Tests/varLib/interpolate_layout_test.py +++ b/Tests/varLib/interpolate_layout_test.py @@ -162,22 +162,6 @@ class InterpolateLayoutTest(unittest.TestCase): with self.assertRaisesRegex(DesignSpaceDocumentError, "No axes defined"): instfont = interpolate_layout(ds_path, {'weight': 500}) - def test_varlib_interpolate_layout_GSUB_only_otf(self): - """A smoke-test for layout-interpolating of OTFs.""" - ds_path = self.get_test_input('InterpolateLayout.designspace') - ds = DesignSpaceDocument.fromfile(ds_path) - ttx_dir = self.get_test_input('master_ttx_interpolatable_otf') - - self.temp_dir() - ttx_paths = self.get_file_list(ttx_dir, '.ttx', 'TestFamily2-') - for path, source in zip(ttx_paths, ds.sources): - font = TTFont(recalcBBoxes=False, recalcTimestamp=False) - font.importXML(path) - source.font = font - - finder = lambda s: s - instfont = interpolate_layout(ds, {'weight': 500}, finder) - def test_varlib_interpolate_layout_GPOS_only_size_feat_same_val_ttf(self): """Only GPOS; 'size' feature; same values in all masters. """