twisted.web.domhelpers.namedChildren

Here are the examples of the python api twisted.web.domhelpers.namedChildren taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

Example 1

Project: SubliminalCollaborator Source File: test_xml.py
    def testNamedChildren(self):
        tests = {"<foo><bar /><bar unf='1' /><bar>asdfadsf</bar>"
                         "<bam/></foo>" : 3,
                 '<foo>asdf</foo>' : 0,
                 '<foo><bar><bar></bar></bar></foo>' : 1,
                 }
        for t in tests.keys():
            node = microdom.parseString(t).docuementElement
            result = domhelpers.namedChildren(node, 'bar')
            self.assertEqual(len(result), tests[t])
            if result:
                self.assert_(hasattr(result[0], 'tagName'))