Beispiel #1
0
def test_dumps_xml(d,s):
    assert dumps_xml(d) == s
Beispiel #2
0
def test_dumps_xml_comment():
    assert dumps_xml({"key": "value"}, comment='This is a comment.') == '''\
Beispiel #3
0
def test_dumps_xml_entities():
    assert dumps_xml({'&<>"\'': '&<>"\''}, comment='&<>"\'') == '''\
def test_dumps_xml_ordereddict_sorted():
    assert dumps_xml(
        OrderedDict([("key", "value"), ("zebra", "apple")]),
        sort_keys=True,
    ) == '''\
Beispiel #5
0
def test_dumps_xml_sorted(d,s):
    assert dumps_xml(d, sort_keys=True) == s
def test_dumps_xml_nothing():
    assert dumps_xml({}) == '''\
def test_dumps_xml_ordereddict_rev():
    assert dumps_xml(OrderedDict([("zebra", "apple"),
                                  ("key", "value")])) == '''\
def test_dumps_xml_two_simple_rev_sorted():
    assert dumps_xml(
        [("zebra", "apple"), ("key", "value")],
        sort_keys=True,
    ) == '''\
def test_dumps_xml_two_simple_rev():
    assert dumps_xml([("zebra", "apple"), ("key", "value")]) == '''\
def test_dumps_xml_simple():
    assert dumps_xml({"key": "value"}) == '''\