diff options
-rw-r--r-- | tests/test_swiftstory.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/test_swiftstory.py b/tests/test_swiftstory.py index c2780d5..6a1f639 100644 --- a/tests/test_swiftstory.py +++ b/tests/test_swiftstory.py @@ -5,8 +5,20 @@ from swiftstory.Status import error class TestSwiftStory(unittest.TestCase): - def test_invalid_message_received(self): + def test_receive_invalid_json(self): self.assertEqual( error("badly formatted json"), SwiftStory.message_received_handler(client=None, message="{invalid_json}") ) + + def test_receive_unknown_command(self): + self.assertEqual( + error("invalid command"), + SwiftStory.message_received_handler(client=None, message='{"op": "unknown"}') + ) + + def test_receive_without_command(self): + self.assertEqual( + error("invalid command"), + SwiftStory.message_received_handler(client=None, message='{}') + ) |