Did I find the right examples for you? yes no

All Samples(78)  |  Call(64)  |  Derive(0)  |  Import(14)

        def _run_xml(source_xml, transform_xml, expected, parameters=None,
              source_uri=None, transform_uri=None,
             processor_kwargs={}):
    _run(source_xml, transform_xml, expected, parameters,
         treecompare.xml_diff, source_uri, transform_uri,
         processor_kwargs)
        


src/a/m/Amara-2.0.0/test/xslt/test_key.py   Amara(Download)
from amara.xslt import XsltError
 
from xslt_support import _run_xml, _run_html, _run_text
 
module_name = os.path.dirname(__file__)
def test_key_7():
    """included keys (test_key_7)"""
    _run_xml(
        source_xml = FILE_SOURCE_XML,
        source_uri = FILE_URI,
def test_key_8():
    """included keys (test_key_8)"""
    _run_xml(
        source_xml = "<dummy/>",
        transform_uri = TRANSFORM_URI,
def test_key_9():
    """included keys (test_key_9)"""
    _run_xml(
        source_xml = "<dummy/>",
        transform_uri = TRANSFORM_URI,
def test_key_error_1():
    """keys using patterns of form `ns:*`"""
    try:
        _run_xml(
            source_xml = FILE_SOURCE_XML,

src/a/m/Amara-2.0.0/test/xslt/test_fallback.py   Amara(Download)
########################################################################
# test/xslt/test_fallback.py
 
from amara.xslt import XsltError
from xslt_support import _run_xml, _run_html
def test_fallback_1():
    """1.0 stylesheet with non-1.0 top-level element"""
    _run_xml(
        source_xml = FALLBACK_SOURCE_XML,
        transform_uri = TRANSFORM_URI,
    # (should be ignored / no error)
    _run_xml(
        source_xml = FALLBACK_SOURCE_XML,
        transform_uri = TRANSFORM_URI,
        transform_xml = """<?xml version="1.0"?>
def test_fallback_4():
    """1.0 literal result element with fallback"""
    _run_xml(
        source_xml = FALLBACK_SOURCE_XML,
        transform_uri = TRANSFORM_URI,
def test_fallback_5():
    """uninstantiated non-1.0 literal result element"""
    _run_xml(
        source_xml = FALLBACK_SOURCE_XML,
        source_uri = "file:xslt/test_fallback.py",

src/a/m/Amara-2.0.0/test/xslt/test_if.py   Amara(Download)
#import os
from amara.lib import inputsource
from xslt_support import _run_xml, _run_html
from amara.test import file_finder
 
def test_if_1():
    """`xsl:if`"""
    _run_xml(
        source_xml = inputsource(FILE("addr_book1.xml")),
        transform_uri = "file:xslt/test_if.py",
def test_if_2():
    """test text and element children of `xsl:if`"""
    _run_xml(
        source_xml = """<?xml version="1.0"?><dummy/>""",
        transform_xml = """<?xml version="1.0"?>

src/a/m/Amara-2.0.0/test/xslt/test_apply_imports.py   Amara(Download)
########################################################################
# test/xslt/test_apply_imports.py
from amara.xslt import XsltError
 
from xslt_support import _run_xml
def test_apply_imports_1():
    _run_xml(
        source_xml = '<example>This is an example</example>',
        transform_xml = """<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
def test_apply_imports_2():
    _run_xml(
        source_xml = """<?xml version="1.0"?>
<doc><example>This is an example<inconnu/></example></doc>""",
        transform_xml = """<?xml version="1.0"?>
def test_apply_imports_3():
    _run_xml(
        source_xml = '<example>This is an example</example>',
        transform_xml = """<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
def test_apply_imports_error_1():
    """xsl:apply-imports with xsl:param children"""
    try:
        _run_xml(
            source_xml = """<?xml version="1.0"?><dummy/>""",

src/a/m/Amara-2.0.0/test/xslt/test_copy_of.py   Amara(Download)
########################################################################
# test/xslt/test_copy_of.py
 
import os
from xslt_support import _run_xml
def test_copy_of_1():
    """copy element and contents"""
    _run_xml(
        source_xml = """<?xml version="1.0"?>
<foo>Embedded <html><a href='link'>go</a>.</html></foo>""",
def test_copy_of_2():
    """copy external document"""
    _run_xml(
        source_xml = """<?xml version="1.0"?><dummy/>""",
        transform_uri = "file:" + module_dirname + "/test_copy_of.py",

src/a/m/Amara-2.0.0/test/xslt/test_copy.py   Amara(Download)
import os
from amara.lib import inputsource
from xslt_support import _run_xml
 
module_dirname = os.path.dirname(__file__)
 
def test_copy_1():
    """`xsl:copy`"""
    _run_xml(
        source_xml = """<?xml version="1.0"?>
def test_copy_2():
    """identity transform"""
    _run_xml(
        source_xml = inputsource(os.path.join(module_dirname, 'addr_book1.xml')),
        source_uri = "file:" + module_dirname + "/addr_book1.xml",

src/a/m/Amara-2.0.0/test/xslt/test_attribute.py   Amara(Download)
PREFIX_TEMPLATE = xmlwriter.xmlwriter.GENERATED_PREFIX
 
from xslt_support import _run_xml
 
SOURCE_XML = """<?xml version="1.0"?><dummy/>"""
 
def test_attribute_1():
    """`xsl:attribute` as child of literal result element"""
    _run_xml(
        source_xml = SOURCE_XML,
def test_attribute_2():
    """`xsl:attribute` as child of literal result element"""
    _run_xml(
        source_xml = SOURCE_XML,
        transform_xml = """<?xml version="1.0"?>
def test_attribute_3():
    """`xsl:attribute` with namespace"""
    _run_xml(
        source_xml = SOURCE_XML,
        transform_xml = """<?xml version="1.0"?>
def test_attribute_4():
    """adding attributes with the same expanded-name"""
    _run_xml(
        source_xml = SOURCE_XML,
        transform_xml = """<?xml version="1.0"?>

src/a/m/Amara-2.0.0/test/xslt/test_apply_templates.py   Amara(Download)
########################################################################
# test/xslt/test_apply_templates.py
from amara.xslt import XsltError
 
from xslt_support import _run_xml
def test_apply_templates_1():
    """`xsl:apply-templates`"""
    _run_xml(
        source_xml = SOURCE_XML,
        transform_xml = """<?xml version="1.0"?>
def test_apply_templates_2():
    """`xsl:apply-templates` using `xsl:sort`"""
    _run_xml(
        source_xml = SOURCE_XML,
        transform_xml ="""<?xml version="1.0"?>
def test_apply_templates_3():
    """`xsl:apply-templates` using `xsl:with-param`"""
    _run_xml(
        source_xml = SOURCE_XML,
        transform_xml = """<?xml version="1.0"?>
def test_apply_templates_4():
    """`xsl:apply-templates` using `xsl:sort` and `xsl:with-param`"""
    _run_xml(
        source_xml = SOURCE_XML,
        transform_xml = """<?xml version="1.0"?>

src/a/m/Amara-2.0.0/test/xslt/test_literals.py   Amara(Download)
########################################################################
# test/xslt/test_literals.py
 
from xslt_support import _run_xml
 
def test_literals_1():
    _run_xml(
        source_xml = """<customer id="uo">Uche Ogbuji</customer>""",
def test_literals_2():
    _run_xml(
        source_xml = """<?xml version="1.0"?><foo/>""",
        transform_xml = """<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

src/a/m/Amara-2.0.0/test/xslt/test_elem_attr.py   Amara(Download)
import os
from amara.lib import inputsource
from xslt_support import _run_html, _run_xml
 
module_dirname = os.path.dirname(__file__)
def test_elem_attr_2():
    """`xsl:element` with namespaces"""
    _run_xml(
        source_xml = '<?xml version="1.0"?><dummy/>',
        transform_xml = """<?xml version="1.0" encoding="utf-8"?>
def test_elem_attr_3():
    """`xsl:attribute` with namespaces"""
    _run_xml(
        source_xml = '<?xml version="1.0"?><dummy/>',
        transform_xml = """<?xml version="1.0" encoding="utf-8"?>

  1 | 2  Next