[NOT AN ISSUE] KeyError for testlink project name

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

Locked
vdanny
TestLink user
Posts: 5
Joined: Sat Sep 07, 2013 5:15 pm

[NOT AN ISSUE] KeyError for testlink project name

Post by vdanny »

Earlier I was using testlink 1.9.5 and now it is updated to 1.9.11. In one of script test project names is fetched with following code:

[x for x in testLinkServer.tl.getProjects(testLinkArgs) if x['name']== 'Projec_Name'][0]['id']

This code was working with 1.9.5 but with 1.9.11 I am getting error: KeyError: 'name'

Any help to resolve this issue on 1.9.11 will be highly appreciated.

TIA.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: KeyError for testlink project name

Post by fman »

probably return data type has been changed.
I suggest to try with our PHP sample client and then change your implementation
vdanny
TestLink user
Posts: 5
Joined: Sat Sep 07, 2013 5:15 pm

Re: KeyError for testlink project name

Post by vdanny »

fman wrote:probably return data type has been changed.
I suggest to try with our PHP sample client and then change your implementation
I tried to run sample clientGetProjects.py and in the received response I can see that 'name' is still a valid return type.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: KeyError for testlink project name

Post by fman »

Unfortunately I'm not able to understand what your last post means.
1. Issue is still there ?
2. ONLY clients that are updated are PHP, other examples provided with distribution can be updated.
vdanny
TestLink user
Posts: 5
Joined: Sat Sep 07, 2013 5:15 pm

Re: KeyError for testlink project name

Post by vdanny »

Yes Issue is still there.
I used the clientGetProjects.py to get the details of testlink projects. Received response is

[{'opt': {'requirementsEnabled': 1, 'testPriorityEnabled': 1, 'automationEnabled': 1, 'inventoryEnabled': 1}, 'prefix': 'my_Prefix', 'name': 'my_Project', 'color': '', 'notes': '<p>\n\t&nbsp;project description</p>',.....}]

Here key 'name' is available in project details. My expectation is when I am using this key in a query, it should work fine. But I am receiving KeyError instead.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: KeyError for testlink project name

Post by fman »

>> My expectation is when I am using this key in a query, it should work fine
SQL Query ?
against what table ?
vdanny
TestLink user
Posts: 5
Joined: Sat Sep 07, 2013 5:15 pm

Re: KeyError for testlink project name

Post by vdanny »

Found issue in python script.
Thanks for you valuable time and support.
Locked