How to use the javaproperties.loads_xml function in javaproperties

To help you get started, we’ve selected a few javaproperties examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jwodder / javaproperties / test / test_loads_xml.py View on Github external
def test_loads_xml_no_key():
    with pytest.raises(ValueError) as excinfo:
        loads_xml('value')
    assert ' is missing "key" attribute' in str(excinfo.value)
github jwodder / javaproperties / test / test_loads_xml.py View on Github external
def test_loads_xml_bad_root():
    with pytest.raises(ValueError) as excinfo:
        loads_xml('value')
    assert 'not rooted at ' in str(excinfo.value)
github jwodder / javaproperties / test / test_loads_xml.py View on Github external
def test_loads_xml(s,d):
    assert loads_xml(s) == d
github jwodder / javaproperties / test / test_loads_xml.py View on Github external
def test_loads_xml_multiple_ordereddict():
    assert loads_xml('''

    value
    bar

''', object_pairs_hook=OrderedDict) == \
        OrderedDict([("key", "value"), ("foo", "bar")])
github jwodder / javaproperties / test / test_loads_xml.py View on Github external
def test_loads_xml_multiple_ordereddict_rev():
    assert loads_xml('''

    bar
    value

''', object_pairs_hook=OrderedDict) == \
        OrderedDict([("foo", "bar"), ("key", "value")])