Solution
It is normal that the method is returnning the NoneType to its caller.
Whether the self-test code is 0 or 1 is checked within the Self-Test method.
For example, you could refer to the
implementation of this method (please feel free to take a look at the souce code as it's an opensource project of nimi Pyhton modules), or the Python code snippet below:
@ivi_synchronized
def self_test(self):
code, msg = self._self_test()
if code:
raise errors.SelfTestError(code, msg)
return None
you may find out the variable 'code' is checked by the if statement to determine the behavior based on the self-test code; in addition, if you would like to know whether there is an error during the self-test proceudre, you could try to catch the SelfTestError object by except syntax for further steps to take in your code.
For example:
try:
self_test()
except SelfTestError:
"""
your action upon catching the self-test error.
"""
pass