From 3c8c1f71a6a084cef31539d25a4c1f1b25cd06dd Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 21 Sep 2017 13:41:47 +0530 Subject: [PATCH] Update test. --- tests/call_function_test.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/call_function_test.py b/tests/call_function_test.py index d33c49ed..d18af3cb 100644 --- a/tests/call_function_test.py +++ b/tests/call_function_test.py @@ -8,6 +8,10 @@ class CrazyType(object): pass +def function_that_adds_numbers(x, y): + return x + y + + def function_that_fails(): raise ValueError('exception text') @@ -38,6 +42,9 @@ class CallFunctionTest(unittest.TestCase): cls.broker.shutdown() cls.broker.join() + def test_succeeds(self): + assert 3 == self.local.call(function_that_adds_numbers, 1, 2) + def test_crashes(self): try: self.local.call(function_that_fails) @@ -62,7 +69,7 @@ class CallFunctionTest(unittest.TestCase): except mitogen.core.StreamError, e: pass - assert e[0] == "attempted unpickle from 'call_function_test'" + assert e[0] == "cannot unpickle 'call_function_test'/'CrazyType'" def test_returns_dead(self): assert mitogen.core._DEAD == self.local.call(func_returns_dead)