From c7be064ef6f55e5ce1021550f80e08343ac55269 Mon Sep 17 00:00:00 2001 From: David Jones Date: Mon, 3 Jun 2024 17:01:20 +0100 Subject: [PATCH] Test absent hex attribute on unicode element (currently fails) --- Tests/ufoLib/GLIF1_test.py | 16 ++++++++++++++++ Tests/ufoLib/GLIF2_test.py | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/Tests/ufoLib/GLIF1_test.py b/Tests/ufoLib/GLIF1_test.py index c4991ca3e..64af3f6a2 100644 --- a/Tests/ufoLib/GLIF1_test.py +++ b/Tests/ufoLib/GLIF1_test.py @@ -300,6 +300,22 @@ class TestGLIF1(unittest.TestCase): self.assertRaises(GlifLibError, self.pyToGLIF, py) self.assertRaises(GlifLibError, self.glifToPy, glif) + def testUnicodes_hex_present(self): + """Test that a present element must have a + 'hex' attribute; by testing that an invalid + element raises an appropriate error. + """ + + # illegal + glif = """ + + + + + + """ + self.assertRaises(GlifLibError, self.glifToPy, glif) + def testNote(self): glif = """ diff --git a/Tests/ufoLib/GLIF2_test.py b/Tests/ufoLib/GLIF2_test.py index d8c96d653..f4ee4271f 100644 --- a/Tests/ufoLib/GLIF2_test.py +++ b/Tests/ufoLib/GLIF2_test.py @@ -300,6 +300,22 @@ class TestGLIF2(unittest.TestCase): self.assertRaises(GlifLibError, self.pyToGLIF, py) self.assertRaises(GlifLibError, self.glifToPy, glif) + def testUnicodes_hex_present(self): + """Test that a present element must have a + 'hex' attribute; by testing that an invalid + element raises an appropriate error. + """ + + # illegal + glif = """ + + + + + + """ + self.assertRaises(GlifLibError, self.glifToPy, glif) + def testNote(self): glif = """