Пример #1
0
    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}))
Пример #2
0
    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)))