Exemplo n.º 1
0
    def test_grouping(self):
        it = parse_accesses(['123', '124'], None)
        self.assertEqual(1, len(it))

        it = it[0]
        self.assertEqual('h', it.modbus_type)
        self.assertEqual(123, it.address())
        self.assertEqual('!H', it.pack_type())
        self.assertEqual(None, it.presenter())
        self.assertEqual(2, it.size())
Exemplo n.º 2
0
    def test_full(self):
        it = parse_accesses(['i@123/<4H:STATUS'], None)
        self.assertEqual(1, len(it))

        it = it[0]
        self.assertEqual('i', it.modbus_type)
        self.assertEqual(123, it.address())
        self.assertEqual('<4H', it.pack_type())
        self.assertEqual(':STATUS', it.presenter())
        self.assertEqual(4, it.size())