forked from g4l4drim/TestLink-API-Python-client
-
Notifications
You must be signed in to change notification settings - Fork 64
Closed
Labels
Description
Hello,thanks for writing this library.It help me a lot to communicate with testlink.
My question is when I add a keyword which has not been created,it will response like this.
{'validKeywords': {'Auto01-4': ''}, 'status_ok': False}
So when the keyword not exist in project,I want to create this keyword.
But it seems to not have this kind of function.
Is there any way can deal with this problem?Or I need to send a API request directly to create keyword?
This is my sample code.
kw_to_add = ['keyword01','keyword02']
self.tls = testlink.TestLinkHelper().connect(testlink.TestlinkAPIClient)
case_more_info = self.tls.getTestCase(testcaseid=CASE_ID)[0]
kw_in_case = self.tls.getTestCaseKeywords(testcaseid=CASE_ID)
for kw in kw_to_add:
if kw not in kw_in_case[CASE_ID]:
insert_kw = {case_more_info['full_tc_external_id']: [kw]}
add_kw_action = self.tls.addTestCaseKeywords(insert_kw)
print(add_kw_action)If keyword has existed in project,add_kw_action will be like:
{'validKeywords': {'Auto01-4': {'821': 'keyword01'}}, 'status_ok': True}
If keyword not exist,add_kw_action will be like:
{'validKeywords': {'Auto01-4': ''}, 'status_ok': False}
Sorry for my poor English.