How to use the minimalmodbus._checkFunctioncode function in minimalmodbus

To help you get started, we’ve selected a few minimalmodbus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyhys / minimalmodbus / test / test_minimalmodbus.py View on Github external
def testWrongListType(self):
        self.assertRaises(TypeError,  minimalmodbus._checkFunctioncode, 4, 4)
        self.assertRaises(TypeError,  minimalmodbus._checkFunctioncode, 4, 'ABC')
        self.assertRaises(TypeError,  minimalmodbus._checkFunctioncode, 4, (4, 5))
        self.assertRaises(ValueError, minimalmodbus._checkFunctioncode, 4, [4, -23])
        self.assertRaises(ValueError, minimalmodbus._checkFunctioncode, 4, [4, 128])
        self.assertRaises(TypeError,  minimalmodbus._checkFunctioncode, 4, [4, '5'])
        self.assertRaises(TypeError,  minimalmodbus._checkFunctioncode, 4, [4, None])
        self.assertRaises(TypeError,  minimalmodbus._checkFunctioncode, 4, [4, [5]])
        self.assertRaises(TypeError,  minimalmodbus._checkFunctioncode, 4, [4.0, 5])
github pyhys / minimalmodbus / test / test_minimalmodbus.py View on Github external
def testCorrectFunctioncode(self):
        minimalmodbus._checkFunctioncode( 4, [4, 5] )
github pyhys / minimalmodbus / test / test_minimalmodbus.py View on Github external
def testCorrectFunctioncodeNoRange(self):
        minimalmodbus._checkFunctioncode( 4, None )
        minimalmodbus._checkFunctioncode( 75, None )
github pyhys / minimalmodbus / test / test_minimalmodbus.py View on Github external
def testCorrectFunctioncodeNoRange(self):
        minimalmodbus._checkFunctioncode( 4, None )
        minimalmodbus._checkFunctioncode( 75, None )