1from fontTools.feaLib.error import FeatureLibError 2from fontTools.feaLib.location import FeatureLibLocation 3import unittest 4 5 6class FeatureLibErrorTest(unittest.TestCase): 7 def test_str(self): 8 err = FeatureLibError("Squeak!", FeatureLibLocation("foo.fea", 23, 42)) 9 self.assertEqual(str(err), "foo.fea:23:42: Squeak!") 10 11 def test_str_nolocation(self): 12 err = FeatureLibError("Squeak!", None) 13 self.assertEqual(str(err), "Squeak!") 14 15 16if __name__ == "__main__": 17 import sys 18 sys.exit(unittest.main()) 19