From 1bf3bd22d764dae90acda4a3fa22447c4f923f41 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Mar 21 2018 19:08:26 +0000 Subject: protonmsg: unit test for unencodable data --- diff --git a/tests/test_plugins/test_protonmsg.py b/tests/test_plugins/test_protonmsg.py index b45d5e9..9d51e97 100644 --- a/tests/test_plugins/test_protonmsg.py +++ b/tests/test_plugins/test_protonmsg.py @@ -27,6 +27,12 @@ class TestProtonMsg(unittest.TestCase): protonmsg.queue_msg('test.msg', {'testheader': 1}, 'test body') self.assertMsg('test.msg', body='"test body"', testheader=1) + def test_queue_msg_not_serializable(self): + # mostly just testing that encoder does not error on data that cannot + # be json encoded + protonmsg.queue_msg('koji@example.com', {'testheader': 1}, object()) + self.assertMsg('koji@example.com', body=None, testheader=1) + def test_prep_package_list_change_add(self): protonmsg.prep_package_list_change('postPackageListChange', action='add', tag={'name': 'test-tag'},