summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Nemec <bnemec@redhat.com>2018-02-08 16:58:42 +0000
committerSean McGinnis <sean.mcginnis@gmail.com>2018-02-18 11:24:00 +0000
commit50897c0b0a5d389f1571d4079e10643ab537fa53 (patch)
treeaac065394a651a5e532ea179e04d135449b69670
parentc4ce1ab56cbbd8e7f2962e9578b19059244c825f (diff)
downloadtaskflow-50897c0b0a5d389f1571d4079e10643ab537fa53.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 (cherry picked from commit 44ce6eae918d44c0ee85998d0526e916dee8de26)
-rw-r--r--taskflow/tests/unit/worker_based/test_protocol.py6
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(