Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(22)  |  Call(20)  |  Derive(0)  |  Import(2)

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_featureinfo.py   MapProxy(Download)
from nose.tools import eq_
 
from mapproxy.featureinfo import (combined_inputs, XSLTransformer,
    XMLFeatureInfoDoc, HTMLFeatureInfoDoc)
from mapproxy.test.helper import strip_whitespace
    def test_transformer(self):
        t = XSLTransformer(self.xsl_script)
        doc = t.transform(XMLFeatureInfoDoc('<a><b>Text</b></a>'))
        eq_(strip_whitespace(doc.as_string()), '<root><foo>Text</foo></root>')
 
    def test_multiple(self):
        t = XSLTransformer(self.xsl_script)
        doc = t.transform(XMLFeatureInfoDoc.combine([
            XMLFeatureInfoDoc(x) for x in 
    def test_as_string(self):
        input_tree = etree.fromstring('<root></root>')
        doc = XMLFeatureInfoDoc(input_tree)
        eq_(strip_whitespace(doc.as_string()),
            '<root/>')
 
    def test_as_etree(self):
        doc = XMLFeatureInfoDoc('<root>hello</root>')

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_featureinfo.py   mapproxy(Download)
from nose.tools import eq_
 
from mapproxy.featureinfo import (combined_inputs, XSLTransformer,
    XMLFeatureInfoDoc, HTMLFeatureInfoDoc)
from mapproxy.test.helper import strip_whitespace
    def test_transformer(self):
        t = XSLTransformer(self.xsl_script)
        doc = t.transform(XMLFeatureInfoDoc('<a><b>Text</b></a>'))
        eq_(strip_whitespace(doc.as_string()), '<root><foo>Text</foo></root>')
 
    def test_multiple(self):
        t = XSLTransformer(self.xsl_script)
        doc = t.transform(XMLFeatureInfoDoc.combine([
            XMLFeatureInfoDoc(x) for x in 
    def test_as_string(self):
        input_tree = etree.fromstring('<root></root>')
        doc = XMLFeatureInfoDoc(input_tree)
        eq_(strip_whitespace(doc.as_string()),
            '<root/>')
 
    def test_as_etree(self):
        doc = XMLFeatureInfoDoc('<root>hello</root>')