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