From 98f6021522c1f89ae7ccd5a3a7f3df5136edc3cf Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sat, 12 Sep 2020 22:42:48 +0200 Subject: Add test for invalid JSON received Signed-off-by: Olivier Gayot --- tests/test_swiftstory.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/test_swiftstory.py (limited to 'tests') diff --git a/tests/test_swiftstory.py b/tests/test_swiftstory.py new file mode 100644 index 0000000..c2780d5 --- /dev/null +++ b/tests/test_swiftstory.py @@ -0,0 +1,12 @@ +import unittest + +import swiftstory.SwiftStory as SwiftStory +from swiftstory.Status import error + + +class TestSwiftStory(unittest.TestCase): + def test_invalid_message_received(self): + self.assertEqual( + error("badly formatted json"), + SwiftStory.message_received_handler(client=None, message="{invalid_json}") + ) -- cgit v1.2.3