ssh://ubuntu@10.2.48.152:22/usr/bin/python -u /tmp/pycharm_project_446/testtestlink.py
Traceback (most recent call last):
File "/tmp/pycharm_project_446/testtestlink.py", line 30, in <module>
print tlc.createTestProject('测试', 'cs', active=1, public=1)
File "/tmp/pycharm_project_446/testlink/testlinkdecorators.py", line 112, in wrapperAddDevKey
return methodAPI(self, *argsPositional, **argsOptional)
File "/tmp/pycharm_project_446/testlink/testlinkdecorators.py", line 100, in wrapperWithArgs
*argsPositional, **argsOptional)
File "/tmp/pycharm_project_446/testlink/testlinkapigeneric.py", line 1584, in callServerWithPosArgs
self._checkResponse(response, methodNameAPI, argsOptional)
File "/tmp/pycharm_project_446/testlink/testlinkapigeneric.py", line 2167, in _checkResponse
response[0]['message'], response[0]['code'])
testlink.testlinkerrors.TLResponseError: <exception str() failed>
Process finished with exit code 1
so I debug the error. I found the error in _checkResponse
def _checkResponse(self, response, methodNameAPI, argsOptional):
""" Checks if RESPONSE is empty or includes Error Messages
Will raise TLRepsonseError in this case """
if response:
try:
**_if 'code' in response[0]_**:
raise testlinkerrors.TLResponseError(
methodNameAPI, argsOptional,
response[0]['message'], response[0]['code'])
except (TypeError, KeyError):
# if the reponse has not a [{..}] structure, the check
# 'code' in response[0]
# raise an error. Following causes are ok
# TypeError: raised from doesUserExist, cause the postiv
# response is simply 'True'
# KeyError: raise from uploadExecutionAttachment, cause the
# positiv response is directly a dictionary
pass
else:
raise testlinkerrors.TLResponseError(methodNameAPI, argsOptional,
'Empty Response! ')
when I create project with the keyword createTestProject , it returns me error
so I debug the error. I found the error in _checkResponse
there may should be if 'code' not in response[0]