Page 1 of 1

[NOT AN ISSUE] KeyError for testlink project name

PostPosted: Mon Aug 18, 2014 11:16 pm
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.

Re: KeyError for testlink project name

PostPosted: Tue Aug 19, 2014 7:35 am
by fman
probably return data type has been changed.
I suggest to try with our PHP sample client and then change your implementation

Re: KeyError for testlink project name

PostPosted: Tue Aug 19, 2014 10:01 pm
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.

Re: KeyError for testlink project name

PostPosted: Wed Aug 20, 2014 8:39 am
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.

Re: KeyError for testlink project name

PostPosted: Wed Aug 20, 2014 3:35 pm
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.

Re: KeyError for testlink project name

PostPosted: Wed Aug 20, 2014 6:36 pm
by fman
>> My expectation is when I am using this key in a query, it should work fine
SQL Query ?
against what table ?

Re: KeyError for testlink project name

PostPosted: Wed Aug 20, 2014 8:20 pm
by vdanny
Found issue in python script.
Thanks for you valuable time and support.