def test_remove_with_single_key(self): d = { 'a': 1, 'b': 2, 'c': 3, } _remove(d, 'c') r = { 'a': 1, 'b': 2, } self.assertEqual(d, r)
def test_remove_with_multiple_keys_as_list(self): d = { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, } _remove(d, ['c', 'd', 'e']) r = { 'a': 1, 'b': 2, } self.assertEqual(d, r)
def remove(self, keys, *args): """ Remove multiple keys from the current dict instance. It is possible to pass a single key or more keys (as list or *args). """ _remove(self, keys, *args)