Skip to content

Commit

Permalink
Copy ahem font
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca committed Jan 4, 2020
1 parent 9710bb8 commit c1c5556
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions tests/test_declaration.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,17 +443,17 @@ def test_list_property(self):

# Check valid values
node.style.font_family = ['serif']
node.style.font_family = ["'Arial Black'", 'serif']
node.style.font_family = ["'DejaVu Sans'", 'serif']

# TODO: This will coerce to a list, is this a valid behavior?
node.style.font_family = '"Arial Black"'
self.assertEqual(node.style.font_family, ['"Arial Black"'])
node.style.font_family = '"DejaVu Sans"'
self.assertEqual(node.style.font_family, ['"DejaVu Sans"'])
node.style.font_family = ' " Arial Black " , serif '
self.assertEqual(node.style.font_family, ['"Arial Black"', 'serif'])
self.assertEqual(node.style.font_family, ['"DejaVu Sans"', 'serif'])

# Check invalid values
with self.assertRaises(ValueError):
node.style.font_family = ['Arial Black']
node.style.font_family = ['DejaVu Sans']

# Check the error message
try:
Expand Down Expand Up @@ -711,9 +711,9 @@ def test_font_shorthand_property(self):
node.style.font_variant = 'small-caps'
node.style.font_size = '10px'
node.style.line_height = '1.5'
node.style.font_family = ['"Arial Black"', 'serif']
node.style.font_family = ['"DejaVu Sans"', 'serif']
# TODO: Is this the behavior we want?
self.assertEqual(node.style.font, 'italic small-caps bold 10.0px/1.5 "Arial Black", serif')
self.assertEqual(node.style.font, 'italic small-caps bold 10.0px/1.5 "DejaVu Sans", serif')

# Check setting the shorthand resets values
node.style.font = '9px serif'
Expand All @@ -733,7 +733,7 @@ def test_font_shorthand_property(self):
node.style.font_variant = 'small-caps'
node.style.font_size = '10px'
node.style.line_height = '1.5'
node.style.font_family = ['"Arial Black"', 'serif']
node.style.font_family = ['"DejaVu Sans"', 'serif']
self.assertEqual(node.style.font, '9px serif')

# Check invalid values
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'font_weight': 'bold',
'font_size': 'large',
'line_height': 'normal',
'font_family': ['Palatino', 'serif'],
'font_family': ['Ahem', 'serif'],
},
r'normal small-caps 120%/120% fantasy': {
'font_style': 'normal',
Expand Down

0 comments on commit c1c5556

Please sign in to comment.