def test_id(self): element = Element("div") element.id = "Test-ID" assert_equal("Test-ID", element.id) assert_equal('<div id="Test-ID"></div>', str(element)) element.id = "" assert_is_none(element.id) assert_equal("<div></div>", str(element)) element.id = None assert_is_none(element.id) assert_equal("<div></div>", str(element))
def test_id(self): element = Element("div") element.id = "Test-ID" assert_equal("Test-ID", element.id) assert_equal('<div id="Test-ID"></div>', str(element)) element.id = "" assert_is_none(element.id) assert_equal('<div></div>', str(element)) element.id = None assert_is_none(element.id) assert_equal('<div></div>', str(element))
def test_id_space(self): element = Element("div") with assert_raises(ValueError): element.id = "Test ID"