def test_get_set(self): from cocktail.html.element import Element e = Element() # Style declarations can be set and read e.set_style("font-weight", "bold") e.set_style("margin", "1em") self.assertEqual(e.get_style("font-weight"), "bold") self.assertEqual(e.get_style("margin"), "1em") # Style declarations can be changed e.set_style("font-weight", "normal") self.assertEqual(e.get_style("font-weight"), "normal")
def get_undefined(self): from cocktail.html.element import Element e = Element() # Getting an undefined style declaration yields None self.assertTrue(e.get_style("font-weight") is None)