示例#1
0
class BaseHandlerTestCase(BaseTestCase):

    def setUp(self):

        super().setUp()
        self.packet = mock_packet()
        self.handler = BaseHandler()

    def test_logger(self):

        self.assertEqual(self.handler.log.name, 'home.collect.BaseHandler')

    def test_format_packet(self):

        formatted = self.handler.format_packet(self.packet.raw)
        expected = '0x11 0x5a 0x01 0x00 0x2e 0xb2 0x03 0x00 0x00'

        self.assertEqual(formatted, expected)
示例#2
0
    def setUp(self):

        super().setUp()
        self.packet = mock_packet()
        self.handler = BaseHandler()