Skip to content

KeyError thrown in getProjectIDByNode #149

Open
@elapfra

Description

@elapfra

Hi,

Thanks for this library, it works great.

However, I encounter this error while running "TestLinkExample.py"

Traceback (most recent call last):
  File "/home/elapfra/code/TestLink-API-Python-client/example/TestLinkExample.py", line 713, in <module>
    response = myTestLink.copyTCnewVersion(newTestCaseID_B, 
  File "/home/elapfra/code/TestLink-API-Python-client/src/testlink/testlinkapi.py", line 188, in copyTCnewVersion
    return self._copyTC(origTestCaseId, changedAttributes, origVersion, 
  File "/home/elapfra/code/TestLink-API-Python-client/src/testlink/testlinkapi.py", line 258, in _copyTC
    origArgItems['testprojectid'] = self.getProjectIDByNode(origTestCaseId)
  File "/home/elapfra/code/TestLink-API-Python-client/src/testlink/testlinkapi.py", line 166, in getProjectIDByNode
    node_path = self.getFullPath(int(a_nodeid))[a_nodeid]
KeyError: 563

It seems to me the dict should be accessed by string.
This works.
node_path = self.getFullPath(int(a_nodeid))[str(a_nodeid)]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions