def test_case04():
    cm = ConfigManager()
    result = cm.readConfigFile('config.ini')
    connection = result['connection']
    assert len(connection) > 0
    assert isinstance(connection, dict)
    assert len(connection) > 0
    assert 'port' in connection.keys()
def my_setup():
    global a, b, c, d, e, f, g, m, n, o, p, y, x
    a = ConfigManager().defaults
    y = ConfigManager().defaults.copy()
    y['apiKeyValue'] = '/tmp/mykey'

    b, c = parse_cmd_args([])
    d, e = parse_cmd_args(['-p', '8443', '-t', '/etc/my_tls'])
    f, g = parse_cmd_args(
        ['-p', '8443', '-t', None, '-k', 'None', '-m', "None"])
    m, n = parse_cmd_args(['-d', 'yes'])
    o, p = parse_cmd_args(['-v', 'e40960c9-de0a-4c75-bc71-0bcae6db23b2'])
def test_case10():
    cm = ConfigManager()
    result = cm.defaults
    if version < "7.0":
        assert int(result['port']) == 4242 and int(result['serverPort']) == 9084
    else:
        assert int(result['port']) == 4242 and int(result['serverPort']) == 9980
Ejemplo n.º 4
0
def my_setup():
    global a, b, c, d, e, f, g, m, n
    a = ConfigManager().defaults
    b, c = parse_cmd_args([])
    d, e = parse_cmd_args(['-p', '8443', '-t', '/etc/my_tls'])
    f, g = parse_cmd_args(
        ['-p', '8443', '-t', None, '-k', 'None', '-m', "None"])
    m, n = parse_cmd_args(['-d', 'yes'])
def test_case13():
    cm = ConfigManager()
    result = cm.defaults
    assert 'protocol' in result.keys()
    assert result['protocol'] == 'http'
def test_case12():
    cm = ConfigManager()
    result = cm.defaults
    assert 'apiKeyValue' not in result.keys()
def test_case11():
    cm = ConfigManager()
    result = cm.defaults
    assert 'includeDiskData' in result.keys()
    assert result['includeDiskData'] == 'no'
def test_case09():
    cm = ConfigManager()
    result = cm.defaults
    value = int(result['port'])
    assert value == 4242
def test_case08():
    cm = ConfigManager()
    result = cm.defaults
    elements = list(result.keys())
    mandatoryItems = ['port', 'serverPort']
    assert all(item in elements for item in mandatoryItems)
def test_case07():
    cm = ConfigManager()
    result = cm.parse_defaults()
    result1 = cm.defaults
    assert len(result) == len(result1)
def test_case01():
    cm = ConfigManager()
    result = cm.readConfigFile('config.ini')
    assert isinstance(result, dict)
def test_case06():
    cm = ConfigManager()
    result = cm.parse_defaults()
    assert len(result.keys()) > 0
def test_case05():
    cm = ConfigManager()
    result = cm.parse_defaults()
    assert isinstance(result, dict)
def test_case03():
    cm = ConfigManager()
    result = cm.readConfigFile('config.ini')
    assert 'tls' in result.keys()
def test_case02():
    cm = ConfigManager()
    result = cm.readConfigFile('config.ini')
    assert len(result.keys()) > 0