2015-08-21 17:09:46 +02:00
|
|
|
from fontTools.feaLib.error import FeatureLibError
|
2020-07-02 14:09:10 +01:00
|
|
|
from fontTools.feaLib.location import FeatureLibLocation
|
2015-08-21 17:09:46 +02:00
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
|
|
class FeatureLibErrorTest(unittest.TestCase):
|
|
|
|
def test_str(self):
|
2020-07-02 14:09:10 +01:00
|
|
|
err = FeatureLibError("Squeak!", FeatureLibLocation("foo.fea", 23, 42))
|
2015-08-21 17:09:46 +02:00
|
|
|
self.assertEqual(str(err), "foo.fea:23:42: Squeak!")
|
|
|
|
|
|
|
|
def test_str_nolocation(self):
|
|
|
|
err = FeatureLibError("Squeak!", None)
|
|
|
|
self.assertEqual(str(err), "Squeak!")
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2017-01-11 13:05:35 +00:00
|
|
|
import sys
|
|
|
|
sys.exit(unittest.main())
|