def test_add_to_non_list(): dictionary = {'key': 'value1'} patcher = Patcher(dictionary) with pytest.raises(exceptions.InvalidKeyTypeException): patcher.add(key='key', value='value2')
def test_add_to_non_list(): dictionary = {'key': 'value1'} patcher = Patcher(dictionary) with pytest.raises(exceptions.InvalidKeyTypeException): patcher.add(key='key', value='value2')
def test_add(): dictionary = {'key': ['value1']} expected_dictionary = {'key': ['value1', 'value2']} patcher = Patcher(dictionary) patcher.add(key='key', value='value2') assert expected_dictionary == dictionary
def test_add_to_complex_key(): dictionary = {'key1': {'key2': ['value1']}} expected_dictionary = {'key1': {'key2': ['value1', 'value2']}} patcher = Patcher(dictionary) patcher.add(key='key1:key2', value='value2') assert expected_dictionary == dictionary
def test_add(): dictionary = {'key': ['value1']} expected_dictionary = {'key': ['value1', 'value2']} patcher = Patcher(dictionary) patcher.add(key='key', value='value2') assert expected_dictionary == dictionary
def test_add_to_complex_key(): dictionary = { 'key1': { 'key2': ['value1'] } } expected_dictionary = { 'key1': { 'key2': ['value1', 'value2'] } } patcher = Patcher(dictionary) patcher.add(key='key1:key2', value='value2') assert expected_dictionary == dictionary