def test_add_all(self):
     a = {"a": "foo", "b": {"ba": 42, "bb": {}}}
     b = {"__all__": {"ba": 1}}
     assert update_config(a, b) == {
         "a": {
             "ba": 1
         },
         "b": {
             "ba": 1,
             "bb": {}
         }
     }
 def test_nested_add_mod(self):
     a = {"a": "foo", "b": {"ba": 42, "bb": {}}}
     b = {"b": {"bb": {"bba": 1}, "bc": [1, 2, 3]}}
     assert update_config(a, b) == {
         "a": "foo",
         "b": {
             "ba": 42,
             "bb": {
                 "bba": 1
             },
             "bc": [1, 2, 3]
         },
     }
 def test_nested_add_mod(self):
     a = {'a': 'foo', 'b': {'ba': 42, 'bb': {}}}
     b = {'b': {'bb': {'bba': 1}, 'bc': [1, 2, 3]}}
     eq_(update_config(a, b), {
         'a': 'foo',
         'b': {
             'ba': 42,
             'bb': {
                 'bba': 1
             },
             'bc': [1, 2, 3]
         }
     })
 def test_suffix_wildcard(self):
     a = {
         "test_foo": "foo",
         "test_bar": "ba",
         "test2_foo": "test2",
         "nounderfoo": 1
     }
     b = {"test____": 42}
     assert update_config(a, b) == {
         "test_foo": 42,
         "test_bar": 42,
         "test2_foo": "test2",
         "nounderfoo": 1,
     }
 def test_suffix_wildcard(self):
     a = {
         'test_foo': 'foo',
         'test_bar': 'ba',
         'test2_foo': 'test2',
         'nounderfoo': 1
     }
     b = {'test____': 42}
     eq_(update_config(a, b), {
         'test_foo': 42,
         'test_bar': 42,
         'test2_foo': 'test2',
         'nounderfoo': 1
     })
 def test_mod(self):
     a = {'a': 'foo', 'b': 42, 'c': {}}
     b = {'a': [1, 2, 3], 'c': 1}
     eq_(update_config(a, b),
         {'b': 42, 'a': [1, 2, 3], 'c': 1})
 def test_mod(self):
     a = {'a': 'foo', 'b': 42, 'c': {}}
     b = {'a': [1, 2, 3], 'c': 1}
     eq_(update_config(a, b), {'b': 42, 'a': [1, 2, 3], 'c': 1})
 def test_mod(self):
     a = {"a": "foo", "b": 42, "c": {}}
     b = {"a": [1, 2, 3], "c": 1}
     assert update_config(a, b) == {"b": 42, "a": [1, 2, 3], "c": 1}
 def test_add(self):
     a = {"a": "foo", "b": 42}
     b = {"c": [1, 2, 3]}
     assert update_config(a, b) == {"a": "foo", "b": 42, "c": [1, 2, 3]}
Example #10
0
 def test_empty(self):
     a = {"a": "foo", "b": 42}
     b = {}
     assert update_config(deepcopy(a), b) == a
 def test_suffix_wildcard(self):
     a = {'test_foo': 'foo', 'test_bar': 'ba', 'test2_foo': 'test2', 'nounderfoo': 1}
     b = {'test____': 42}
     eq_(update_config(a, b),
         {'test_foo': 42, 'test_bar': 42, 'test2_foo': 'test2', 'nounderfoo': 1})
 def test_extend(self):
     a = {'a': 'foo', 'b': ['ba']}
     b = {'b__extend__': ['bb', 'bc']}
     eq_(update_config(a, b),
         {'a': 'foo', 'b': ['ba', 'bb', 'bc']})
 def test_add_all(self):
     a = {'a': 'foo', 'b': {'ba': 42, 'bb': {}}}
     b = {'__all__': {'ba': 1}}
     eq_(update_config(a, b),
         {'a': {'ba': 1}, 'b': {'ba': 1, 'bb': {}}})
Example #14
0
 def test_add(self):
     a = {'a': 'foo', 'b': 42}
     b = {'c': [1, 2, 3]}
     eq_(update_config(a, b), {'a': 'foo', 'b': 42, 'c': [1, 2, 3]})
Example #15
0
 def test_extend(self):
     a = {"a": "foo", "b": ["ba"]}
     b = {"b__extend__": ["bb", "bc"]}
     assert update_config(a, b) == {"a": "foo", "b": ["ba", "bb", "bc"]}
 def test_add(self):
     a = {'a': 'foo', 'b': 42}
     b = {'c': [1, 2, 3]}
     eq_(update_config(a, b),
         {'a': 'foo', 'b': 42, 'c': [1, 2, 3]})
 def test_empty(self):
     a = {'a': 'foo', 'b': 42}
     b = {}
     eq_(update_config(deepcopy(a), b), a)
Example #18
0
 def test_extend(self):
     a = {'a': 'foo', 'b': ['ba']}
     b = {'b__extend__': ['bb', 'bc']}
     eq_(update_config(a, b), {'a': 'foo', 'b': ['ba', 'bb', 'bc']})
Example #19
0
 def test_add_all(self):
     a = {'a': 'foo', 'b': {'ba': 42, 'bb': {}}}
     b = {'__all__': {'ba': 1}}
     eq_(update_config(a, b), {'a': {'ba': 1}, 'b': {'ba': 1, 'bb': {}}})
 def test_nested_add_mod(self):
     a = {'a': 'foo', 'b': {'ba': 42, 'bb': {}}}
     b = {'b': {'bb': {'bba': 1}, 'bc': [1, 2, 3]}}
     eq_(update_config(a, b),
         {'a': 'foo', 'b': {'ba': 42, 'bb': {'bba': 1}, 'bc': [1, 2, 3]}})
Example #21
0
 def test_empty(self):
     a = {'a': 'foo', 'b': 42}
     b = {}
     eq_(update_config(deepcopy(a), b), a)