def test_compresses_shorthand_properties(self): properties = Properties({ 'margin-top': '10px', 'margin-right': '10px', 'margin-bottom': '10px', 'margin-left': '10px', }) assert '%s' % (properties, ) == 'margin: 10px'
def test_serializes_to_attribute_string(self): properties = Properties({ 'font-weight': 'bold', 'color': 'red', }) # XXX: Ordering is non-deterministic, so we have to check both variations. expected = set(( 'font-weight: bold; color: red', 'color: red; font-weight: bold', )) self.assertIn(u'%s' % (properties, ), expected)