Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def testCorrectResponseWritedata(self):
minimalmodbus._checkResponseWriteData('\x00\x2d\x00\x58', '\x00\x58')
minimalmodbus._checkResponseWriteData('\x00\x2d\x00\x58', minimalmodbus._numToTwoByteString(88))
minimalmodbus._checkResponseWriteData('\x00\x47\xff\x00', '\xff\x00')
minimalmodbus._checkResponseWriteData('\x00\x47\xff\x00', minimalmodbus._numToTwoByteString(65280))
minimalmodbus._checkResponseWriteData('\x00\x2d\x00\x58ABCDEFGHIJKLMNOP', '\x00\x58')
def testCorrectResponseWritedata(self):
minimalmodbus._checkResponseWriteData('\x00\x2d\x00\x58', '\x00\x58')
minimalmodbus._checkResponseWriteData('\x00\x2d\x00\x58', minimalmodbus._numToTwoByteString(88))
minimalmodbus._checkResponseWriteData('\x00\x47\xff\x00', '\xff\x00')
minimalmodbus._checkResponseWriteData('\x00\x47\xff\x00', minimalmodbus._numToTwoByteString(65280))
minimalmodbus._checkResponseWriteData('\x00\x2d\x00\x58ABCDEFGHIJKLMNOP', '\x00\x58')
def testCorrectResponseWritedata(self):
minimalmodbus._checkResponseWriteData('\x00\x2d\x00\x58', '\x00\x58')
minimalmodbus._checkResponseWriteData('\x00\x2d\x00\x58', minimalmodbus._numToTwoByteString(88))
minimalmodbus._checkResponseWriteData('\x00\x47\xff\x00', '\xff\x00')
minimalmodbus._checkResponseWriteData('\x00\x47\xff\x00', minimalmodbus._numToTwoByteString(65280))
minimalmodbus._checkResponseWriteData('\x00\x2d\x00\x58ABCDEFGHIJKLMNOP', '\x00\x58')
def testCorrectResponseWritedata(self):
minimalmodbus._checkResponseWriteData('\x00\x2d\x00\x58', '\x00\x58')
minimalmodbus._checkResponseWriteData('\x00\x2d\x00\x58', minimalmodbus._numToTwoByteString(88))
minimalmodbus._checkResponseWriteData('\x00\x47\xff\x00', '\xff\x00')
minimalmodbus._checkResponseWriteData('\x00\x47\xff\x00', minimalmodbus._numToTwoByteString(65280))
minimalmodbus._checkResponseWriteData('\x00\x2d\x00\x58ABCDEFGHIJKLMNOP', '\x00\x58')
def testTooShortString(self):
self.assertRaises(ValueError, minimalmodbus._checkResponseWriteData, '\x00\x58', '\x00\x58')
self.assertRaises(ValueError, minimalmodbus._checkResponseWriteData, '', '\x00\x58')
self.assertRaises(ValueError, minimalmodbus._checkResponseWriteData, '\x00\x2d\x00\x58', '\x58')
self.assertRaises(ValueError, minimalmodbus._checkResponseWriteData, '\x00\x2d\x00\x58', '')