def testCallFnDict(self): sum_fn = lambda a, b: a + b self.assertEqual(3, fun_mcmc.call_fn(sum_fn, [1, 2])) self.assertEqual(3, fun_mcmc.call_fn(sum_fn, {'a': 1, 'b': 2}))
def testCallFn(self): sum_fn = lambda *args: sum(args) self.assertEqual(1, fun_mcmc.call_fn(sum_fn, 1)) self.assertEqual(3, fun_mcmc.call_fn(sum_fn, (1, 2)))