source: exist/branches/proglue_production_rev4605_xquery4884/python/elementtree-1.3a6-20070212-badc/unittests/test_iter.py @ 4886

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/exist/branches/proglue_production_rev4605_xquery4884/python/elementtree-1.3a6-20070212-badc/unittests/test_iter.py@4886
Revision 4886, 723 bytes checked in by sdonegan, 10 years ago (diff)

Creating operational branch for ndgUtils as used on proglue

Line 
1# $Id: test_iter.py 3306 2007-09-16 19:57:36Z fredrik $
2
3from support import *
4
5def iterators():
6    """
7    Test iterators.
8
9    >>> e = ET.XML("<html><body>this is a <i>paragraph</i>.</body>..</html>")
10
11    >>> summarize_list(e.iter())
12    ['html', 'body', 'i']
13    >>> summarize_list(e.getiterator())
14    ['html', 'body', 'i']
15    >>> isinstance(e.getiterator(), list)
16    True
17    >>> summarize_list(e.find("body").iter())
18    ['body', 'i']
19
20    >>> "".join(e.itertext())
21    'this is a paragraph...'
22    >>> "".join(e.find("body").itertext())
23    'this is a paragraph.'
24
25    >>> e.append(ET.Comment("this is a comment"))
26    >>> "".join(e.itertext())
27    'this is a paragraph...'
28
29    """
Note: See TracBrowser for help on using the repository browser.