Ejemplo n.º 1
0
 def test_process_payload(self):
     payload = {
         "level1": {
             "level2": [1, 3],
             "level2a": lambda *a, **b: "{}{}".format(len(a), len(b))
         },
         "level1a": {1, 2}
     }
     expected = {
         "level1": {
             "level2": [1, 3],
             "level2a": "22"
         },
         "level1a": {1, 2}
     }
     assert process_payload(payload, 1, 2, a=4, b=5) == expected
Ejemplo n.º 2
0
 def test_just_callable_arg(self):
     assert process_payload(lambda x: x**2, 2) == 4