From bdf6327ad72f162ca16a16c446d2093ffb75f143 Mon Sep 17 00:00:00 2001 From: James Godfrey-Kittle Date: Tue, 29 Sep 2015 17:33:54 -0700 Subject: Move all name tests to common_tests --- scripts/common_tests.py | 18 ++++++++++++++++++ scripts/run_web_tests.py | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/common_tests.py b/scripts/common_tests.py index 952e794..f30afa0 100644 --- a/scripts/common_tests.py +++ b/scripts/common_tests.py @@ -238,6 +238,24 @@ class TestNames(FontTest): self.assertIn(17, records) self.assertEqual(records[17], self.build_style(weight, slope)) + def test_unique_identifier_and_full_name(self): + """Tests the unique identifier and full name.""" + 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 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) + def test_postscript_name_for_spaces(self): """Tests that there are no spaces in PostScript names.""" for records in self.names: diff --git a/scripts/run_web_tests.py b/scripts/run_web_tests.py index 7687989..8ec42be 100755 --- a/scripts/run_web_tests.py +++ b/scripts/run_web_tests.py @@ -43,24 +43,6 @@ class TestNames(common_tests.TestNames): family_name = 'Roboto' mark_heavier_as_bold = True - def test_unique_identifier_and_full_name(self): - """Tests the unique identifier and full name.""" - 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 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) - class TestDigitWidths(common_tests.TestDigitWidths): loaded_fonts = FONTS -- cgit v1.2.3