def test_lacks_id(): """Verify that a node does not have an id in our set.""" test_pattern = re.compile('test1|test2', re.I) test_node = fragment_fromstring('<div/>') test_node.set('id', 'test4') assert not check_node_attributes(test_pattern, test_node, 'id')
def test_lacks_class(self): """Verify that a node does not have a class in our set.""" test_pattern = re.compile('test1|test2', re.I) test_node = fragment_fromstring('<div/>') test_node.set('class', 'test4 comment') self.assertFalse( check_node_attributes(test_pattern, test_node, 'class'))
def test_has_class(): """Verify that a node has a class in our set.""" test_pattern = re.compile('test1|test2', re.I) test_node = fragment_fromstring('<div/>') test_node.set('class', 'test2 comment') assert check_node_attributes(test_pattern, test_node, 'class')
def test_has_id(self): """Verify that a node has an id in our set.""" test_pattern = re.compile('test1|test2', re.I) test_node = fragment_fromstring('<div/>') test_node.set('id', 'test2') self.assertTrue(check_node_attributes(test_pattern, test_node, 'id'))