summaryrefslogtreecommitdiff
path: root/scripts/run_web_tests.py
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk19@gmail.com>2015-09-29 13:29:05 -0700
committerJames Godfrey-Kittle <jamesgk19@gmail.com>2015-09-29 13:29:05 -0700
commit08202e2581802067d111b1e0ac3b66e1e8dad03b (patch)
tree0f794e44f381a9ef4d69095dc3ab85d7338dad10 /scripts/run_web_tests.py
parente4c60429d80c7263b07caf105d8af793954d1950 (diff)
parentfdb4746fee87a222b9b2f52f179174f3ccfd97b1 (diff)
Merge pull request #111 from jamesgk/add-tests
Add family name tests
Diffstat (limited to 'scripts/run_web_tests.py')
-rwxr-xr-xscripts/run_web_tests.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/run_web_tests.py b/scripts/run_web_tests.py
index 3ff483a..f201114 100755
--- a/scripts/run_web_tests.py
+++ b/scripts/run_web_tests.py
@@ -32,6 +32,7 @@ class TestItalicAngle(common_tests.TestItalicAngle):
class TestMetaInfo(common_tests.TestMetaInfo):
loaded_fonts = FONTS
+ mark_heavier_as_bold = True
# Since different font files are hinted at different times, the actual
# outlines differ slightly. So we are keeping the version numbers as a hint.
test_version_numbers = None
@@ -40,19 +41,24 @@ class TestMetaInfo(common_tests.TestMetaInfo):
class TestNames(common_tests.TestNames):
loaded_fonts = FONTS
family_name = 'Roboto'
+ mark_heavier_as_bold = True
def test_unique_identifier_and_full_name(self):
"""Tests the unique identifier and full name."""
- for records in self.names:
- expected_name = records[1] + ' ' + records[2]
+ for font_file, records in zip(self.font_files, self.names):
+ family, weight, slope = self.parse_filename(font_file)
+ style = self.build_style(weight, slope)
+ expected_name = family + ' ' + style
self.assertEqual(records[3], expected_name)
self.assertEqual(records[4], expected_name)
self.assertFalse(records.has_key(18))
def test_postscript_name(self):
"""Tests the postscript name."""
- for records in self.names:
- expected_name = (records[1] + '-' + records[2]).replace(' ', '')
+ for font_file, records in zip(self.font_files, self.names):
+ family, weight, slope = self.parse_filename(font_file)
+ style = self.build_style(weight, slope)
+ expected_name = (family + '-' + style).replace(' ', '')
self.assertEqual(records[6], expected_name)