Beispiel #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))
Beispiel #2
0
 def test_no_id(self):
     element = Element("foo")
     self.assertFalse(has_id(element))
Beispiel #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))
Beispiel #4
0
 def test_none(self):
     self.assertFalse(has_id(None))