This repository has been archived on 2025-01-23. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2025-01-23/src/tests/test_chatmsg.py

23 lines
666 B
Python

"""
Test for chatmsg group
"""
import unittest
from messagetypes.chatmsg import Chatmsg
class TestCharMessage(unittest.TestCase):
"""
Test case for chat message group
"""
def test_decode(self):
"""Test various types of decode method"""
import messagetypes
result = messagetypes.constructObject({'': 'chatmsg', 'message': 'hello world'})
self.assertTrue(isinstance(result.message, str))
def test_encode(self):
"""Test various types of encode method"""
chat_obj = Chatmsg()
result = chat_obj.encode({'message': 'hello world'})
self.assertTrue(True if result['message'] else False)