Exemple #1
0
 def test_multiple(self):
     t = XSLTransformer(self.xsl_script)
     doc = t.transform(XMLFeatureInfoDoc.combine([
         XMLFeatureInfoDoc(x) for x in
             [b'<a><b>ab</b></a>',
              b'<a><b>ab1</b><b>ab2</b><b>ab3</b></a>',
              b'<a><b>ab1</b><c>ac</c><b>ab2</b></a>',
         ]]))
     eq_(strip_whitespace(doc.as_string()),
         strip_whitespace(b'''
         <root>
           <foo>ab</foo>
           <foo>ab1</foo><foo>ab2</foo><foo>ab3</foo>
           <foo>ab1</foo><foo>ab2</foo>
         </root>'''))
     eq_(doc.info_type, 'xml')
 def test_multiple(self):
     t = XSLTransformer(self.xsl_script)
     doc = t.transform(XMLFeatureInfoDoc.combine([
         XMLFeatureInfoDoc(x) for x in
             [b'<a><b>ab</b></a>',
              b'<a><b>ab1</b><b>ab2</b><b>ab3</b></a>',
              b'<a><b>ab1</b><c>ac</c><b>ab2</b></a>',
         ]]))
     eq_(strip_whitespace(doc.as_string()),
         strip_whitespace(b'''
         <root>
           <foo>ab</foo>
           <foo>ab1</foo><foo>ab2</foo><foo>ab3</foo>
           <foo>ab1</foo><foo>ab2</foo>
         </root>'''))
     eq_(doc.info_type, 'xml')
 def test_multiple(self):
     t = XSLTransformer(self.xsl_script)
     doc = t.transform(
         XMLFeatureInfoDoc.combine([
             XMLFeatureInfoDoc(x) for x in [
                 b"<a><b>ab</b></a>",
                 b"<a><b>ab1</b><b>ab2</b><b>ab3</b></a>",
                 b"<a><b>ab1</b><c>ac</c><b>ab2</b></a>",
             ]
         ]))
     assert strip_whitespace(doc.as_string()) == strip_whitespace(b"""
         <root>
           <foo>ab</foo>
           <foo>ab1</foo><foo>ab2</foo><foo>ab3</foo>
           <foo>ab1</foo><foo>ab2</foo>
         </root>""")
     assert doc.info_type == "xml"
Exemple #4
0
 def test_transformer(self):
     t = XSLTransformer(self.xsl_script)
     doc = t.transform(XMLFeatureInfoDoc('<a><b>Text</b></a>'))
     eq_(strip_whitespace(doc.as_string()), b'<root><foo>Text</foo></root>')
Exemple #5
0
 def test_transformer(self):
     t = XSLTransformer(self.xsl_script)
     doc = t.transform(XMLFeatureInfoDoc('<a><b>Text</b></a>'))
     eq_(strip_whitespace(doc.as_string()), b'<root><foo>Text</foo></root>')
 def test_transformer(self):
     t = XSLTransformer(self.xsl_script)
     doc = t.transform(XMLFeatureInfoDoc("<a><b>Text</b></a>"))
     assert strip_whitespace(
         doc.as_string()) == b"<root><foo>Text</foo></root>"