How to use the javaproperties.__main__.javaproperties 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_cmd_format.py View on Github external
def test_cmd_format_file():
    runner = CliRunner()
    with runner.isolated_filesystem():
        with open('test.properties', 'wb') as fp:
            fp.write(INPUT)
        r = CliRunner().invoke(javaproperties, ['format', 'test.properties'])
        assert r.exit_code == 0
        assert r.output_bytes == OUTPUT
github jwodder / javaproperties / test / test_cmd_get.py View on Github external
def test_cmd_get_utf8_not_exists():
    r = CliRunner().invoke(javaproperties, [
        'get', '-', b'x\xC3\xB0'
    ], input=INPUT)
    assert r.exit_code == 1
    assert r.output_bytes == b'javaproperties: x\xC3\xB0: key not found\n'
github jwodder / javaproperties / test / test_cmd_set.py View on Github external
def test_cmd_set_escaped_not_exists():
    r = CliRunner().invoke(javaproperties, [
        'set', '--preserve-timestamp', '--escaped', '-', 'x\\u00F0', '\\u00A1new!'
    ], input=INPUT)
    assert r.exit_code == 0
    assert r.output_bytes == b'''\
foo: bar
github jwodder / javaproperties / test / test_cmd_delete.py View on Github external
def test_cmd_delete_exists():
    r = CliRunner().invoke(javaproperties, [
        'delete', '--preserve-timestamp', '-', 'key'
    ], input=INPUT)
    assert r.exit_code == 0
    assert r.output_bytes == b'''\
foo: bar
github jwodder / javaproperties / test / test_cmd_delete.py View on Github external
def test_cmd_delete_utf8():
    r = CliRunner().invoke(javaproperties, [
        'delete', '--preserve-timestamp', '-', b'e\xC3\xB0'  # 'e\u00f0'
    ], input=INPUT)
    assert r.exit_code == 0
    assert r.output_bytes == b'''\
foo: bar
github jwodder / javaproperties / test / test_cmd_set.py View on Github external
def test_cmd_set_exists():
    r = CliRunner().invoke(javaproperties, [
        'set', '--preserve-timestamp', '-', 'key', 'other value'
    ], input=INPUT)
    assert r.exit_code == 0
    assert r.output_bytes == b'''\
foo: bar
github jwodder / javaproperties / test / test_cmd_select.py View on Github external
def test_cmd_select_bmp_output():
    r = CliRunner().invoke(javaproperties, ['select', '-', 'bmp'], input=INPUT)
    assert r.exit_code == 0
    assert r.output_bytes == b'''\
#Mon Nov 07 15:29:40 EST 2016
github jwodder / javaproperties / test / test_cmd_select.py View on Github external
def test_cmd_select_exists():
    r = CliRunner().invoke(javaproperties, ['select', '-', 'key'], input=INPUT)
    assert r.exit_code == 0
    assert r.output_bytes == b'#Mon Nov 07 15:29:40 EST 2016\nkey=value\n'
github jwodder / javaproperties / test / test_cmd_format.py View on Github external
def test_cmd_format_stdin():
    r = CliRunner().invoke(javaproperties, ['format'], input=INPUT)
    assert r.exit_code == 0
    assert r.output_bytes == OUTPUT
github jwodder / javaproperties / test / test_cmd_get.py View on Github external
def test_cmd_get_exists():
    r = CliRunner().invoke(javaproperties, ['get', '-', 'key'], input=INPUT)
    assert r.exit_code == 0
    assert r.output_bytes == b'value\n'