source: TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/test/test_genshi_util.py @ 3481

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/test/test_genshi_util.py@3481
Revision 3481, 581 bytes checked in by spascoe, 12 years ago (diff)

WMS 1.1.1 capabilities improved

Line 
1"""
2Test functions that work with genshi templates.
3
4@author: Stephen Pascoe
5
6"""
7
8from ows_common.pylons.genshi_util import RenameElementFilter
9from genshi import XML, QName
10
11def test_renameElement():
12    """
13    Check that renameElementFilter renames the root element of a stream.
14
15    """
16    xmlStream = XML('''<foo xmlns="http://example.com" flub="2"><bar baz="1">fofof</bar></foo>''')
17
18    f = RenameElementFilter(QName('waze'))
19
20    xml = (xmlStream | f).render()
21
22    print xml
23
24    assert xml == '<waze xmlns="http://example.com" flub="2"><bar baz="1">fofof</bar></waze>'
Note: See TracBrowser for help on using the repository browser.