lczub / TestLink-API-Python-client

A Python client to use the TestLink API
104 stars 63 forks source link

Is there any method by which we can get project prefix? #108

Closed chintanvadgama closed 6 years ago

chintanvadgama commented 6 years ago

Hi,

I see there are some methods where we have to use project prefix instead of project name or id? For instance, the following method can be called only via Prefix.

@decoApiCallAddDevKey               
@decoMakerApiCallWithArgs(['testsuitename', 'prefix'])
def getTestSuite(self):

So, I wanted to know if there is any method by which we can get the project prefix so that I can set that as a class variable and all my library functions can use that?

lczub commented 6 years ago

Hello Chinton,

maybe getTestProjectByName can help you:

getTestProjectByName {'options': 'O:8:"stdClass":4:{s:19:"requirementsEnabled";i:1;s:19:"testPriorityEnabled";i:1;s:17:"automationEnabled";i:1;s:16:"inventoryEnabled";i:1;}', 'reqmgr_integration_enabled': '0', 'option_priority': '0', 'option_automation': '0', 'is_public': '1', 'active': '1', 'api_key': 'c5b7a64fdf734cc6df539ae076725554506e3f6fe2f89114b5673fccd54f6851', 'option_reqs': '0', 'issue_tracker_enabled': '0', 'tc_counter': '2', 'color': '', 'id': '14894', 'code_tracker_enabled': '0', 'prefix': 'GPROAPI27', 'name': 'PROJECT_API_GENERIC-27', 'opt': {'automationEnabled': 1, 'testPriorityEnabled': 1, 'inventoryEnabled': 1, 'requirementsEnabled': 1}, 'notes': 'Example created with Python 2.7.15 API class TestlinkAPIGeneric v0.8.0 in TL 1.9.17'} hint: A good source to find out, which respons are created by which api method - try to run the sample examples/TestLinkExample.py or examples/TestLinkExampleGenericApi.py

Regards Luiko

chintanvadgama commented 6 years ago

Thanks a lot @lczub. I will look into examples/TestLinkExample.py