def test_em(self): self.assertEqual(10, apply_font_size('1em', 10)) self.assertEqual(8, apply_font_size('0.8em', 10)) self.assertEqual(10, apply_font_size('1.0em', 10)) self.assertEqual(15, apply_font_size('1.5em', 10)) self.assertEqual(15, apply_font_size('1.5 em', 10)) self.assertEqual(15, apply_font_size(' 1.5em ', 10)) self.assertEqual(15, apply_font_size('1.5em ', 10))
def test_em(self): self.assertEqual(10, apply_font_size('1em', 10)) self.assertEqual(8, apply_font_size('0.8em', 10)) self.assertEqual(10, apply_font_size('1.0em', 10)) self.assertEqual(15, apply_font_size('1.5em', 10)) self.assertEqual(15, apply_font_size('1.5 em', 10)) self.assertEqual(15, apply_font_size(' 1.5em ', 10)) self.assertEqual(15, apply_font_size('1.5em ', 10))
def test_ptc(self): self.assertEqual(8, apply_font_size('80%', 10)) self.assertEqual(10, apply_font_size('100%', 10)) self.assertEqual(15, apply_font_size('150%', 10)) self.assertEqual(15, apply_font_size('150 %', 10)) self.assertEqual(15, apply_font_size(' 150% ', 10)) self.assertEqual(15, apply_font_size('150% ', 10))
def test_px(self): self.assertEqual(8, apply_font_size('8px', 10)) self.assertEqual(10, apply_font_size('10px', 10)) self.assertEqual(15, apply_font_size('15px', 10)) self.assertEqual(15, apply_font_size('15 px', 10)) self.assertEqual(15, apply_font_size(' 15px ', 10)) self.assertEqual(15, apply_font_size('15px ', 10))
def test_ptc(self): self.assertEqual(8, apply_font_size('80%', 10)) self.assertEqual(10, apply_font_size('100%', 10)) self.assertEqual(15, apply_font_size('150%', 10)) self.assertEqual(15, apply_font_size('150 %', 10)) self.assertEqual(15, apply_font_size(' 150% ', 10)) self.assertEqual(15, apply_font_size('150% ', 10))
def test_px(self): self.assertEqual(8, apply_font_size('8px', 10)) self.assertEqual(10, apply_font_size('10px', 10)) self.assertEqual(15, apply_font_size('15px', 10)) self.assertEqual(15, apply_font_size('15 px', 10)) self.assertEqual(15, apply_font_size(' 15px ', 10)) self.assertEqual(15, apply_font_size('15px ', 10))