def test_subset_with_keys_as_args(self):
     i = {
         'a': 1,
         'b': 2,
         'c': 3,
         'd': 4,
         'e': 5,
         'f': 6,
     }
     o = _subset(i, 'c', 'f', 'x')
     r = {
         'c': 3,
         'f': 6,
         'x': None,
     }
     self.assertFalse(i is o)
     self.assertEqual(o, r)
Example #2
0
 def subset(self, keys, *args):
     """
     Return a new dict subset for the given keys.
     It is possible to pass a single key or multiple keys (as list or *args).
     """
     return _subset(self, keys, *args)