def test_lists(self): a = {'a': [1]} b = {'a': [2]} r = utils.sum_dicts(a, b) self.assertEqual({'a': [1, 2]}, r)
def test_numbers(self): a = {'a': 1} b = {'a': 2} r = utils.sum_dicts(a, b) self.assertEqual({'a': 3}, r)
def test_numbers_different_key(self): a = {'a': 1} b = {'b': 2} r = utils.sum_dicts(a, b) self.assertEqual({'a': 1, 'b': 2}, r)
def test_empty(self): a = {} b = {} r = utils.sum_dicts(a, b) self.assertEqual({}, r)
def test_with_none(self): a = None b = None r = utils.sum_dicts(a, b) self.assertEqual({}, r)
def test_longer_mix(self): a = {'a': 1, 'b': 2, 'c': [1]} b = {'b': 3, 'c': [4], 'd': [5]} r = utils.sum_dicts(a, b) self.assertEqual({'c': [1, 4], 'b': 5, 'd': [5], 'a': 1}, r)
def test_mix(self): a = {'a': [1]} b = {'a': [2], 'b': 3} r = utils.sum_dicts(a, b) self.assertEqual({'b': 3, 'a': [1, 2]}, r)
def test_lists_different_keys(self): a = {'a': [1]} b = {'b': [2]} r = utils.sum_dicts(a, b) self.assertEqual({'a': [1], 'b': [2]}, r)