Exemple #1
0
def test_update_configuration_copies_new_items(config_copy):
    updates = {'key1': 'value1', 'key2': 'value2'}

    assert not config_copy.get('key1', False)
    assert not config_copy.get('key2', False)

    diet.update_configuration(config_copy, updates)

    assert config_copy['key1'] == 'value1'
    assert config_copy['key2'] == 'value2'
Exemple #2
0
def test_update_configuration_updates_sections(config_copy):
    updates = {'commands': {'advpng': 'advpng', 'gifsicle': 'gifsicle'}}

    assert config_copy['commands']['advpng'] == '/usr/local/bin/advpng'
    assert config_copy['commands']['gifsicle'] == '/usr/local/bin/gifsicle'

    diet.update_configuration(config_copy, updates)

    assert config_copy['commands']['advpng'] == 'advpng'
    assert config_copy['commands']['gifsicle'] == 'gifsicle'
def test_update_configuration_copies_new_items(config_copy):
    updates = {
        'key1': 'value1',
        'key2': 'value2'
    }

    assert not config_copy.get('key1', False)
    assert not config_copy.get('key2', False)

    diet.update_configuration(config_copy, updates)

    assert config_copy['key1'] == 'value1'
    assert config_copy['key2'] == 'value2'
def test_update_configuration_updates_sections(config_copy):
    updates = {
        'commands': {
            'advpng': 'advpng',
            'gifsicle': 'gifsicle'
        }
    }

    assert config_copy['commands']['advpng'] == '/usr/local/bin/advpng'
    assert config_copy['commands']['gifsicle'] == '/usr/local/bin/gifsicle'

    diet.update_configuration(config_copy, updates)

    assert config_copy['commands']['advpng'] == 'advpng'
    assert config_copy['commands']['gifsicle'] == 'gifsicle'