Beispiel #1
0
def test_set_function_saves_the_configuration_to_file():
    config = Configurer(location)
    # only allowed sections for a set function are oxd and client
    assert config.set('client', 'name', 'Test Client')
    assert not config.set('test', 'key', 'value')

    # Ensure things have been written to the file
    config2 = Configurer(location)
    assert config2.get('client', 'name') == 'Test Client'
def test_set_function_saves_the_configuratio_to_file():
    config = Configurer(location)
    test_id = str(uuid.uuid4())
    # only allowed sections for a set function are oxd and client
    assert_true(config.set('oxd', 'id', test_id))
    assert_true(config.set('client', 'name', 'Test Client'))
    assert_false(config.set('test', 'key', 'value'))

    # Ensure things have been written to the file
    config2 = Configurer(location)
    assert_equal(config2.get('oxd', 'id'), test_id)
    assert_equal(config2.get('client', 'name'), 'Test Client')