Finished path search & autocomplete. Added font parsing

This commit is contained in:
simon987
2018-04-16 17:25:34 -04:00
parent b454653d51
commit 6d3cceb1b1
15 changed files with 124 additions and 41 deletions

37
spec/FontParser_spec.py Normal file
View File

@@ -0,0 +1,37 @@
from unittest import TestCase
from parsing import FontParser
class FontParserTest(TestCase):
def test_parse_name_trueType(self):
parser = FontParser([])
info = parser.parse("test_files/truetype1.ttf")
self.assertEqual(info["font_name"], "Liberation Mono Bold")
def test_parse_name_openType(self):
parser = FontParser([])
info = parser.parse("test_files/opentype1.otf")
self.assertEqual(info["font_name"], "Linux Biolinum Keyboard O")
def test_parse_name_woff(self):
parser = FontParser([])
info = parser.parse("test_files/woff.woff")
self.assertEqual(info["font_name"], "Heart of Gold")
def test_parse_name_woff2(self):
parser = FontParser([])
info = parser.parse("test_files/woff2.woff2")
self.assertEqual(info["font_name"], "Heart of Gold")

Binary file not shown.

Binary file not shown.

BIN
spec/test_files/woff.woff Normal file

Binary file not shown.

BIN
spec/test_files/woff2.woff2 Normal file

Binary file not shown.