<commit_before>from common import exec_command


def test_help():
    process = exec_command(['dcos', 'config', '--help'])
    stdout, stderr = process.communicate()

    assert process.returncode == 0
    assert stdout == b"""Usage:
    dcos config info
    dcos config <name> [<value>]
    dcos config --unset <name>
    dcos config --list

Options:
    -h, --help            Show this screen
    --version             Show version
    --unset               Remove property from the config file
"""
    assert stderr == b''


def test_info():
    process = exec_command(['dcos', 'config', 'info'])
    stdout, stderr = process.communicate()

    assert process.returncode == 0
    assert stdout == b'Get and set DCOS command line options\n'
    assert stderr == b''


def test_version():
    process = exec_command(['dcos', 'config', '--version'])
    stdout, stderr = process.communicate()

    assert process.returncode == 0
    assert stdout == b'dcos-config version 0.1.0\n'
    assert stderr == b''


def test_list_property():
    process = exec_command(['dcos', 'config', '--list'])

    stdout, stderr = process.communicate()

    assert process.returncode == 0
    assert stdout == b"""marathon.host=localhost
marathon.port=8080
package.cache=tmp/cache
package.sources=['file:///Users/you/projects/dcos/registry']
"""
    assert stderr == b''


def test_get_existing_property():
    _get_value('marathon.host', 'localhost')


def test_get_missing_proerty():
    _get_missing_value('missing.property')


def test_set_existing_property():
    _set_value('marathon.host', 'newhost')
    _get_value('marathon.host', 'newhost')
    _set_value('marathon.host', 'localhost')


def test_unset_property():
    _unset_value('marathon.host')
    _get_missing_value('marathon.host')
    _set_value('marathon.host', 'localhost')


def test_set_missing_property():
    _set_value('path.to.value', 'cool new value')
    _get_value('path.to.value', 'cool new value')
    _unset_value('path.to.value')
<commit_msg>Update config integration tests for new test data.<commit_after>from common import exec_command


def test_help():
    process = exec_command(['dcos', 'config', '--help'])
    stdout, stderr = process.communicate()

    assert process.returncode == 0
    assert stdout == b"""Usage:
    dcos config info
    dcos config <name> [<value>]
    dcos config --unset <name>
    dcos config --list

Options:
    -h, --help            Show this screen
    --version             Show version
    --unset               Remove property from the config file
"""
    assert stderr == b''


def test_info():
    process = exec_command(['dcos', 'config', 'info'])
    stdout, stderr = process.communicate()

    assert process.returncode == 0
    assert stdout == b'Get and set DCOS command line options\n'
    assert stderr == b''


def test_version():
    process = exec_command(['dcos', 'config', '--version'])
    stdout, stderr = process.communicate()

    assert process.returncode == 0
    assert stdout == b'dcos-config version 0.1.0\n'
    assert stderr == b''


def test_list_property():
    process = exec_command(['dcos', 'config', '--list'])

    stdout, stderr = process.communicate()

    assert process.returncode == 0
    assert stdout == b"""marathon.host=localhost
marathon.port=8080
package.cache=tmp/cache
package.sources=['file:///Users/me/test-registry', \
'https://my.org/registry', \
'git://github.com/mesosphere/universe.git']
"""
    assert stderr == b''


def test_get_existing_property():
    _get_value('marathon.host', 'localhost')


def test_get_missing_proerty():
    _get_missing_value('missing.property')


def test_set_existing_property():
    _set_value('marathon.host', 'newhost')
    _get_value('marathon.host', 'newhost')
    _set_value('marathon.host', 'localhost')


def test_unset_property():
    _unset_value('marathon.host')
    _get_missing_value('marathon.host')
    _set_value('marathon.host', 'localhost')


def test_set_missing_property():
    _set_value('path.to.value', 'cool new value')
    _get_value('path.to.value', 'cool new value')
    _unset_value('path.to.value')

{'fraction_non_alphanumeric': 0.14431486880466474, 'fraction_numerical': 0.005344995140913508, 'mean_word_length': 3.5542035398230087, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5502091', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1282, 'n_words': 307}