How to use the javaproperties.dumps 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_dumps.py View on Github external
def test_dumps_trailing_space_in_value():
    assert dumps({"key": "value "}, timestamp=False) == 'key=value \n'
github jwodder / javaproperties / test / test_dumps.py View on Github external
def test_dumps_vertical_tab():
    assert dumps({"vertical-tab": "\v"}, timestamp=False) == \
        'vertical-tab=\\u000b\n'
github jwodder / javaproperties / test / test_dumps.py View on Github external
def test_dumps_delete():
    assert dumps({"delete": "\x7F"}, timestamp=False) == 'delete=\\u007f\n'
github jwodder / javaproperties / test / test_dumps.py View on Github external
def test_dumps_two_simple():
    assert dumps([("key", "value"), ("zebra", "apple")], timestamp=False) == \
        'key=value\nzebra=apple\n'
github jwodder / javaproperties / test / test_dumps.py View on Github external
def test_dumps_exclamation():
    assert dumps({"exclamation": "!"}, timestamp=False) == 'exclamation=\\!\n'
github jwodder / javaproperties / test / test_dumps.py View on Github external
def test_dumps_multiline_comment():
    assert dumps({"key": "value"}, comments='This is a comment.\nThis is also a comment.', timestamp=False) == '#This is a comment.\n#This is also a comment.\nkey=value\n'
github jwodder / javaproperties / test / test_dumps.py View on Github external
def test_dumps_backslash():
    assert dumps({"backslash": "\\"}, timestamp=False) == 'backslash=\\\\\n'
github jwodder / javaproperties / test / test_dumps.py View on Github external
def test_dumps_hash_comment():
    assert dumps({"key": "value"}, comments='#This is a double comment.', timestamp=False) == '##This is a double comment.\nkey=value\n'
github jwodder / javaproperties / test / test_dumps.py View on Github external
def test_dumps_bell():
    assert dumps({"bell": "\a"}, timestamp=False) == 'bell=\\u0007\n'
github jwodder / javaproperties / test / test_dumps.py View on Github external
def test_dumps_timestamp_and_comment():
    assert dumps(
        {"key": "value"},
        comments='This is a comment.',
        timestamp=1473703254
    ) == '#This is a comment.\n#Mon Sep 12 14:00:54 EDT 2016\nkey=value\n'