33MEI Message Test Fixture
44--------------------------------
55
6- This fixture tests the functionality of all the
6+ This fixture tests the functionality of all the
77mei based request/response messages:
88'''
99import unittest
@@ -45,7 +45,7 @@ def testReadDeviceInformationRequest(self):
4545 control = ModbusControlBlock ()
4646 control .Identity .VendorName = "Company"
4747 control .Identity .ProductCode = "Product"
48- control .Identity .MajorMinorevision = "v2.1.12"
48+ control .Identity .MajorMinorRevision = "v2.1.12"
4949
5050 handle = ReadDeviceInformationRequest ()
5151 result = handle .execute (context )
@@ -69,7 +69,7 @@ def testReadDeviceInformationRequestError(self):
6969 def testReadDeviceInformationResponseEncode (self ):
7070 ''' Test that the read fifo queue response can encode '''
7171 message = '\x0e \x01 \x83 \x00 \x00 \x03 '
72- message += '\x00 \x07 Company\x01 \x07 Product\x02 \x07 v2.1.12'
72+ message += '\x00 \x07 Company\x01 \x07 Product\x02 \x07 v2.1.12'
7373 dataset = {
7474 0x00 : 'Company' ,
7575 0x01 : 'Product' ,
@@ -84,7 +84,7 @@ def testReadDeviceInformationResponseEncode(self):
8484 def testReadDeviceInformationResponseDecode (self ):
8585 ''' Test that the read device information response can decode '''
8686 message = '\x0e \x01 \x01 \x00 \x00 \x03 '
87- message += '\x00 \x07 Company\x01 \x07 Product\x02 \x07 v2.1.12'
87+ message += '\x00 \x07 Company\x01 \x07 Product\x02 \x07 v2.1.12'
8888 handle = ReadDeviceInformationResponse (read_code = 0x00 , information = [])
8989 handle .decode (message )
9090 self .assertEqual (handle .read_code , DeviceInformation .Basic )
@@ -98,6 +98,9 @@ def testRtuFrameSize(self):
9898 message = '\x04 \x2B \x0E \x01 \x81 \x00 \x01 \x01 \x00 \x06 \x66 \x6F \x6F \x62 \x61 \x72 \xD7 \x3B '
9999 result = ReadDeviceInformationResponse .calculateRtuFrameSize (message )
100100 self .assertEqual (result , 18 )
101+ message = '\x00 \x2B \x0E \x02 \x00 \x4D \x47 '
102+ result = ReadDeviceInformationRequest .calculateRtuFrameSize (message )
103+ self .assertEqual (result , 7 )
101104
102105
103106#---------------------------------------------------------------------------#
0 commit comments