File: error_test.py

package info (click to toggle)
fonttools 4.57.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 27,040 kB
  • sloc: python: 140,483; xml: 103; makefile: 41
file content (19 lines) | stat: -rw-r--r-- 541 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from fontTools.feaLib.error import FeatureLibError
from fontTools.feaLib.location import FeatureLibLocation
import unittest


class FeatureLibErrorTest(unittest.TestCase):
    def test_str(self):
        err = FeatureLibError("Squeak!", FeatureLibLocation("foo.fea", 23, 42))
        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__":
    import sys

    sys.exit(unittest.main())