[subset_test] verify that --recal-timestamp actually works

Closes #847
This commit is contained in:
Cosimo Lupo 2017-02-19 20:12:22 -08:00
parent a226c4772b
commit 34fec90630
No known key found for this signature in database
GPG Key ID: B61AAAD0B53A6419

View File

@ -273,6 +273,21 @@ class SubsetTest(unittest.TestCase):
subsetfont = TTFont(subsetpath)
self.expect_ttx(subsetfont, self.getpath("expect_notdef_width_cid.ttx"), ["CFF "])
def test_recalc_timestamp(self):
ttxpath = self.getpath("TestTTF-Regular.ttx")
font = TTFont()
font.importXML(ttxpath)
modified = font['head'].modified
_, fontpath = self.compile_font(ttxpath, ".ttf")
subsetpath = self.temp_path(".ttf")
# by default, the subsetter does not recalculate the modified timestamp
subset.main([fontpath, "--output-file=%s" % subsetpath, "*"])
self.assertEqual(modified, TTFont(subsetpath)['head'].modified)
subset.main([fontpath, "--recalc-timestamp", "--output-file=%s" % subsetpath, "*"])
self.assertLess(modified, TTFont(subsetpath)['head'].modified)
if __name__ == "__main__":
sys.exit(unittest.main())