diff options
author | Ben Nemec <bnemec@redhat.com> | 2018-02-08 16:58:42 +0000 |
---|---|---|
committer | Ben Nemec <bnemec@redhat.com> | 2018-02-08 17:13:05 +0000 |
commit | 44ce6eae918d44c0ee85998d0526e916dee8de26 (patch) | |
tree | c2f0b6f77b70ab928accdccaa56e5559877c5237 | |
parent | 406073e884a406a8950c7c6f066d1019641b9bf5 (diff) | |
download | taskflow-44ce6eae918d44c0ee85998d0526e916dee8de26.tar.gz |
Fix invalid json unit test
Recent versions of oslo.serialization have made it possible to dump
exceptions to JSON, which broke a unit test in taskflow that
assumed exceptions were unserializable. This change switches to an
explicitly unserializable class for that test.
Change-Id: If6d19bc9fcf1f1813cb087d42dc7ba6a61c71b3d
Closes-Bug: 1748241
-rw-r--r-- | taskflow/tests/unit/worker_based/test_protocol.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/taskflow/tests/unit/worker_based/test_protocol.py b/taskflow/tests/unit/worker_based/test_protocol.py index 86a7e89..c253699 100644 --- a/taskflow/tests/unit/worker_based/test_protocol.py +++ b/taskflow/tests/unit/worker_based/test_protocol.py @@ -25,6 +25,10 @@ from taskflow.tests import utils from taskflow.types import failure +class Unserializable(object): + pass + + class TestProtocolValidation(test.TestCase): def test_send_notify(self): msg = pr.Notify() @@ -166,7 +170,7 @@ class TestProtocol(test.TestCase): self.assertEqual(expected, request.to_dict()) def test_to_dict_with_invalid_json_failures(self): - exc = RuntimeError(Exception("I am not valid JSON")) + exc = RuntimeError(Unserializable()) a_failure = failure.Failure.from_exception(exc) request = self.request(failures={self.task.name: a_failure}) expected = self.request_to_dict( |