Esempio n. 1
0
 def test_hexadecimal(self):
     """test getter/setter for the hexadecimal attribute"""
     node1 = HTMLEntity("nbsp")
     node2 = HTMLEntity("107")
     node3 = HTMLEntity("e9")
     self.assertFalse(node1.hexadecimal)
     self.assertFalse(node2.hexadecimal)
     self.assertTrue(node3.hexadecimal)
     node1.hexadecimal = False
     node2.hexadecimal = True
     node3.hexadecimal = False
     self.assertFalse(node1.hexadecimal)
     self.assertTrue(node2.hexadecimal)
     self.assertFalse(node3.hexadecimal)
     self.assertRaises(ValueError, setattr, node1, "hexadecimal", True)
 def test_hexadecimal(self):
     """test getter/setter for the hexadecimal attribute"""
     node1 = HTMLEntity("nbsp")
     node2 = HTMLEntity("107")
     node3 = HTMLEntity("e9")
     self.assertFalse(node1.hexadecimal)
     self.assertFalse(node2.hexadecimal)
     self.assertTrue(node3.hexadecimal)
     node1.hexadecimal = False
     node2.hexadecimal = True
     node3.hexadecimal = False
     self.assertFalse(node1.hexadecimal)
     self.assertTrue(node2.hexadecimal)
     self.assertFalse(node3.hexadecimal)
     self.assertRaises(ValueError, setattr, node1, "hexadecimal", True)