mirror of
https://github.com/simon987/Simple-Incremental-Search-Tool.git
synced 2025-04-10 14:06:41 +00:00
38 lines
925 B
Python
38 lines
925 B
Python
from unittest import TestCase
|
|
from parsing import FontParser
|
|
|
|
|
|
class FontParserTest(TestCase):
|
|
|
|
def test_parse_name_trueType(self):
|
|
|
|
parser = FontParser([], "test_files/")
|
|
|
|
info = parser.parse("test_files/truetype1.ttf")
|
|
|
|
self.assertEqual(info["content"], "Liberation Mono Bold")
|
|
|
|
def test_parse_name_openType(self):
|
|
|
|
parser = FontParser([], "test_files/")
|
|
|
|
info = parser.parse("test_files/opentype1.otf")
|
|
|
|
self.assertEqual(info["content"], "Linux Biolinum Keyboard O")
|
|
|
|
def test_parse_name_woff(self):
|
|
|
|
parser = FontParser([], "test_files/")
|
|
|
|
info = parser.parse("test_files/woff.woff")
|
|
|
|
self.assertEqual(info["content"], "Heart of Gold")
|
|
|
|
def test_parse_name_woff2(self):
|
|
|
|
parser = FontParser([], "test_files/")
|
|
|
|
info = parser.parse("test_files/woff2.woff2")
|
|
|
|
self.assertEqual(info["content"], "Heart of Gold")
|