Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
def test_just_callable_arg(self):
assert process_payload(lambda x: x**2, 2) == 4