Exemplo n.º 1
0
    def test_has_id(self):
        element = Element("foo", attrib={'id': '1'})
        self.assertTrue(has_id(element))

        element = Element("foo", attrib={'id': 'bar'})
        self.assertTrue(has_id(element))
Exemplo n.º 2
0
 def test_no_id(self):
     element = Element("foo")
     self.assertFalse(has_id(element))
Exemplo n.º 3
0
    def test_empty_id(self):
        element = Element("foo", attrib={'id': ''})
        self.assertFalse(has_id(element))

        element = Element("foo", attrib={'id': ' '})
        self.assertFalse(has_id(element))
Exemplo n.º 4
0
 def test_none(self):
     self.assertFalse(has_id(None))