Total Complexity | 6 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | # coding: utf8 |
||
34 | class PicklabilityTestCase(ActionTreeTestCase): |
||
35 | def test_action(self): |
||
36 | with self.assertRaises(pickle.PicklingError): |
||
37 | execute(self._action(unpicklable)) |
||
38 | |||
39 | def test_return_value(self): |
||
40 | with self.assertRaises(pickle.PicklingError): |
||
41 | # DO NOT use self._action(return_value=unpicklable) |
||
42 | # because the *Action* would be unpicklable and we're testing what happens |
||
43 | # when the *return value* is unpicklable |
||
44 | execute(UnpicklableReturnValue("x")) |
||
45 | |||
46 | def test_exception(self): |
||
47 | with self.assertRaises(pickle.PicklingError): |
||
48 | # DO NOT use self._action(return_value=unpicklable) |
||
49 | # because the *Action* would be unpicklable and we're testing what happens |
||
50 | # when the *exception* is unpicklable |
||
51 | execute(UnpicklableException("x")) |
||
52 |