def test_config_merge(): config = Configuration({ 'foo': [4, 2], 'bar': { 'child1': 'one', 'child2': 'two' } }) other = Configuration({ 'baz': True, 'blah': 'blah blah', 'bar': { 'child1': 'other one', 'child10': 'ten' } }) config.merge(other) expected = { 'foo': [4, 2], 'baz': True, 'blah': 'blah blah', 'bar': { 'child1': 'other one', 'child2': 'two', 'child10': 'ten' } } assert config.get() == expected
def test_config_merge(): config = Configuration({ 'foo': [4, 2], 'bar': { 'child1': 'one', 'child2': 'two' } }) other = Configuration({ 'baz': True, 'blah': 'blah blah', 'bar': { 'child1': 'other one', 'child10': 'ten' } }) config.merge(other) expected = { 'foo': [4, 2], 'baz': True, 'blah': 'blah blah', 'bar': { 'child1': 'other one', 'child2': 'two', 'child10': 'ten' } } assert config.getAll() == expected
def test_config_merge_with_mode(mode, expected): config = Configuration({ 'foo': [4, 2], 'bar': 'something' }) other = {'foo': [1, 0], 'bar': 'other thing'} config.merge(other, mode=mode) assert config.getAll() == expected
def test_config_merge_with_mode(mode, expected): config = Configuration({'foo': [4, 2], 'bar': 'something'}) other = {'foo': [1, 0], 'bar': 'other thing'} config.merge(other, mode=mode) assert config.getAll() == expected