Пример #1
0
class PingMessageParserTestCase(unittest.TestCase):
    def setUp(self):
        self.parser = PingMessageParser()

    def test_parse_with_id(self):
        id = 'test'
        message = self.parser.parse({'msg': 'ping', 'id': id})
        self.assertEqual(message, PingMessage(id=id))

    def test_parse_without_id(self):
        message = self.parser.parse({'msg': 'ping'})
        self.assertEqual(message, PingMessage())
Пример #2
0
 def setUp(self):
     self.parser = PingMessageParser()