Skip to content

Commit eeb2081

Browse files
author
Luiko Czub
committed
cleanup of api method doc strings, closes #8
example about description of all implemented api method ``` import testlink tlh = testlink.TestLinkHelper() tls = tlh.connect(testlink.TestlinkAPIGeneric) for m in testlink.testlinkargs._apiMethodsArgs.keys(): print tls.whatArgs(m), '\n' ```
1 parent 7ac681d commit eeb2081

File tree

2 files changed

+41
-120
lines changed

2 files changed

+41
-120
lines changed

Diff for: src/testlink/testlinkapigeneric.py

+40-119
Original file line numberDiff line numberDiff line change
@@ -94,95 +94,71 @@ def __init__(self, server_url, devKey, **args):
9494
@decoApiCallAddDevKey
9595
@decoMakerApiCallWithArgs(['testplanid'])
9696
def getLatestBuildForTestPlan(self):
97-
""" getLatestBuildForTestPlan: Gets the latest build by choosing the
98-
maximum build id for a specific test plan
99-
positional args: testplanid
100-
optional args : --- """
97+
""" Gets the latest build by choosing the maximum build id for a specific test plan """
10198

10299
@decoApiCallAddDevKey
103100
@decoMakerApiCallWithArgs(['testplanid'],
104101
['testcaseid', 'testcaseexternalid'])
105102
def getLastExecutionResult(self):
106-
""" getLastExecutionResult:
107-
Gets the result of LAST EXECUTION for a particular testcase
108-
on a test plan, but WITHOUT checking for a particular build
109-
positional args: testplanid
110-
optional args : testcaseid, testcaseexternalid """
103+
""" Gets the result of LAST EXECUTION for a particular testcase on a test plan,
104+
but WITHOUT checking for a particular build """
111105

112106
@decoApiCallWithoutArgs
113107
def sayHello(self):
114-
""" sayHello: Lets you see if the server is up and running
115-
positional args: ---
116-
optional args : --- """
108+
""" Lets you see if the server is up and running """
117109

118110
def ping(self):
119111
""" alias for methodAPI sayHello """
120112
return self.sayHello()
121113

122114
@decoMakerApiCallWithArgs(['str'])
123115
def repeat(self):
124-
""" repeat: Repeats a message back
125-
positional args: str
126-
optional args : --- """
116+
""" Repeats a message back """
127117

128118
@decoApiCallWithoutArgs
129119
def about(self):
130-
""" about: Gives basic information about the API
131-
positional args: ---
132-
optional args : --- """
120+
""" Gives basic information about the API """
133121

134122
@decoApiCallAddDevKey
135123
@decoMakerApiCallWithArgs(['testplanid', 'buildname'],
136124
['buildnotes'])
137125
def createBuild(self):
138-
""" createBuild: Creates a new build for a specific test plan
139-
positional args: testplanid, buildname
140-
optional args : buildnotes """
126+
""" Creates a new build for a specific test plan """
141127

142128
@decoApiCallAddDevKey
143129
@decoMakerApiCallWithArgs()
144130
def getProjects(self):
145-
""" getProjects: Gets a list of all projects
146-
positional args: ---
147-
optional args : --- """
131+
""" Gets a list of all projects """
148132

149133
@decoMakerApiCallReplaceTLResponseError()
150134
@decoApiCallAddDevKey
151135
@decoMakerApiCallWithArgs(['testprojectid'])
152136
def getProjectTestPlans(self):
153-
""" getProjectTestPlans: Gets a list of test plans within a project
154-
positional args: testprojectid
155-
optional args : ---
137+
""" Gets a list of test plans within a project
156138
157139
returns an empty list, if no testplan is assigned """
158140

159141
@decoMakerApiCallReplaceTLResponseError()
160142
@decoApiCallAddDevKey
161143
@decoMakerApiCallWithArgs(['testplanid'])
162144
def getBuildsForTestPlan(self):
163-
""" getBuildsForTestPlan : Gets a list of builds within a test plan
164-
positional args: testplanid
165-
optional args : ---
145+
""" Gets a list of builds within a test plan
166146
167147
returns an empty list, if no build is assigned """
168148

169149
@decoMakerApiCallReplaceTLResponseError()
170150
@decoApiCallAddDevKey
171151
@decoMakerApiCallWithArgs(['testplanid'])
172152
def getTestSuitesForTestPlan(self):
173-
""" getTestSuitesForTestPlan : List test suites within a test plan alphabetically
174-
positional args: testplanid
175-
optional args : ---
153+
""" List test suites within a test plan alphabetically
176154
177155
returns an empty list, if no build is assigned """
178156

179157
@decoApiCallAddDevKey
180158
@decoMakerApiCallWithArgs(['testprojectname', 'testcaseprefix'],
181159
['notes', 'active', 'public', 'options'])
182160
def createTestProject(self):
183-
""" createTestProject : Create a test project
184-
positional args: testprojectname, testcaseprefix
185-
optional args : notes, active, public, options
161+
""" Create a test project
186162
187163
options : dictionary with keys
188164
requirementsEnabled, testPriorityEnabled,
@@ -193,9 +169,7 @@ def createTestProject(self):
193169
@decoApiCallAddDevKey
194170
@decoMakerApiCallWithArgs(['testsuiteid'], ['deep', 'details'])
195171
def getTestCasesForTestSuite(self):
196-
""" getTestCasesForTestSuite : List test suites within a test plan alphabetically
197-
positional args: testsuiteid
198-
optional args : deep, details
172+
""" List test suites within a test plan alphabetically
199173
200174
details - default is 'simple',
201175
use 'full' if you want to get summary,steps & expected_results
@@ -207,9 +181,7 @@ def getTestCasesForTestSuite(self):
207181
@decoMakerApiCallWithArgs(['testcasename'],
208182
['testsuitename', 'testprojectname', 'testcasepathname'])
209183
def getTestCaseIDByName(self):
210-
""" getTestCaseIDByName : Find a test case by its name
211-
positional args: testcasename,
212-
optional args : testsuitename, testprojectname, testcasepathname
184+
""" Find a test case by its name
213185
214186
testcasepathname : Full test case path name,
215187
starts with test project name , pieces separator -> ::
@@ -222,11 +194,7 @@ def getTestCaseIDByName(self):
222194
['preconditions', 'importance', 'execution', 'order',
223195
'internalid', 'checkduplicatedname', 'actiononduplicatedname'])
224196
def createTestCase(self):
225-
""" createTestCase: Create a test case
226-
positional args: testcasename, testsuiteid, testprojectid, authorlogin,
227-
summary, steps
228-
optional args : preconditions, importance, execution, order, internalid,
229-
checkduplicatedname, actiononduplicatedname
197+
""" Create a test case
230198
231199
steps is a list with dictionaries , example
232200
[{'step_number' : 1, 'actions' : "action A" ,
@@ -243,16 +211,15 @@ def createTestCase(self):
243211
'platformid', 'platformname', 'notes', 'guess', 'bugid',
244212
'customfields', 'overwrite'])
245213
def reportTCResult(self):
246-
""" reportTCResult : Reports a result for a single test case
247-
positional args: testplanid, status
248-
optional args (variations): testcaseid - testcaseexternalid
249-
buildid - buildname
250-
platformid - platformname
251-
optional args : notes, guess, bugid, customfields, overwrite
214+
""" Reports a result for a single test case
215+
216+
args variations: testcaseid - testcaseexternalid
217+
buildid - buildname
218+
platformid - platformname
252219
253220
customfields : dictionary with customfields names + values
254221
VERY IMPORTANT: value must be formatted in the way it's written to db
255-
"""
222+
"""
256223

257224
# /**
258225
# * turn on/off testMode
@@ -270,26 +237,18 @@ def reportTCResult(self):
270237
['testcaseid', 'keywordid', 'keywords', 'executed', 'assignedto',
271238
'executestatus', 'executiontype', 'getstepinfo', 'details'])
272239
def getTestCasesForTestPlan(self):
273-
""" getTestCasesForTestPlan : List test cases linked to a test plan
274-
positional args: testplanid
275-
optional args : testcaseid, keywordid, keywords, executed, assignedto,
276-
executestatus, executiontype, getstepinfo, details
240+
""" List test cases linked to a test plan
277241
278242
details - default is 'full',
279243
'simple', 'details' ??
280-
281244
282245
returns an empty list, if no build is assigned """
283246

284247
@decoApiCallAddDevKey
285248
@decoMakerApiCallWithArgs(['testcaseexternalid', 'version', 'testprojectid',
286249
'customfieldname'], ['details'])
287250
def getTestCaseCustomFieldDesignValue(self):
288-
""" getTestCaseCustomFieldDesignValue :
289-
Gets value of a Custom Field with scope='design' for a given Test case
290-
positional args: testcaseexternalid, version, testprojectid,
291-
customfieldname
292-
optional args : details
251+
""" Gets value of a Custom Field with scope='design' for a given Test case
293252
294253
details = changes output information
295254
null or 'value' => just value
@@ -319,12 +278,8 @@ def getTestCaseCustomFieldDesignValue(self):
319278
@decoApiCallAddDevKey
320279
@decoMakerApiCallWithArgs(['testprojectid'])
321280
def getFirstLevelTestSuitesForTestProject(self):
322-
""" getFirstLevelTestSuitesForTestProject : get set of test suites
323-
AT TOP LEVEL of tree on a Test Project
281+
""" get set of test suites AT TOP LEVEL of tree on a Test Project
324282
325-
positional args: testprojectid
326-
optional args : ---
327-
328283
returns an empty list, if no suite is assigned (api error 7008)
329284
- details see comments for decoMakerApiCallReplaceTLResponseError """
330285

@@ -347,43 +302,32 @@ def getFirstLevelTestSuitesForTestProject(self):
347302
@decoApiCallAddDevKey
348303
@decoMakerApiCallWithArgs([], ['testcaseid', 'testcaseexternalid'])
349304
def getTestCaseAttachments(self):
350-
""" getTestCaseAttachments: Gets attachments for specified test case.
305+
""" Gets attachments for specified test case.
351306
The attachment file content is Base64 encoded. To save the file to disk
352-
in client, Base64 decode the content and write file in binary mode.
353-
positional args: ---
354-
optional args : testcaseid, testcaseexternalid """
307+
in client, Base64 decode the content and write file in binary mode. """
355308

356309
@decoApiCallAddDevKey
357310
@decoMakerApiCallWithArgs(['testprojectid', 'testsuitename', 'details'],
358311
['parentid', 'order', 'checkduplicatedname',
359312
'actiononduplicatedname'])
360313
def createTestSuite(self):
361-
""" createTestSuite: create a test suite
362-
positional args: testprojectid, testsuitename, details
363-
optional args : parentid, order, checkduplicatedname,
364-
actiononduplicatedname """
314+
""" create a test suite """
365315

366316
@decoApiCallAddDevKey
367317
@decoMakerApiCallWithArgs(['testprojectname'])
368318
def getTestProjectByName(self):
369-
""" getTestProjectByName: Gets info about target test project
370-
positional args: testprojectname
371-
optional args : --- """
319+
""" Gets info about target test project """
372320

373321
@decoApiCallAddDevKey
374322
@decoMakerApiCallWithArgs(['testprojectname', 'testplanname'])
375323
def getTestPlanByName(self):
376-
""" getTestPlanByName: Gets info about target test project
377-
positional args: testprojectname, testplanname
378-
optional args : --- """
324+
""" Gets info about target test project """
379325

380326

381327
@decoApiCallAddDevKey
382328
@decoMakerApiCallWithArgs([], ['testcaseid', 'testcaseexternalid', 'version'])
383329
def getTestCase(self):
384-
""" getTestCase: get test case specification using external or internal id
385-
positional args: ---
386-
optional args : testcaseid, testcaseexternalid, version
330+
""" get test case specification using external or internal id
387331
388332
attention - becareful with testcaseexternalid - it must inlcude an '-'.
389333
otherwise TL returns
@@ -393,18 +337,13 @@ def getTestCase(self):
393337
@decoMakerApiCallWithArgs(['testplanname', 'testprojectname'],
394338
['note', 'active', 'public'])
395339
def createTestPlan(self):
396-
""" createTestPlan : create a test plan
397-
positional args: testplanname, testprojectname
398-
optional args : notes, active, public """
340+
""" create a test plan """
399341

400342

401343
@decoApiCallAddDevKey
402344
@decoMakerApiCallWithArgs(['nodeid'])
403345
def getFullPath(self):
404-
""" getFullPath : Gets full path from the given node till the top using
405-
nodes_hierarchy_table
406-
positional args: nodeid
407-
optional args : ---
346+
""" Gets full path from the given node till the top using nodes_hierarchy_table
408347
409348
nodeid = can be just a single id or a list with ids
410349
ATTENTION: id must be an integer. """
@@ -428,55 +367,39 @@ def getFullPath(self):
428367
@decoApiCallAddDevKey
429368
@decoMakerApiCallWithArgs(['testsuiteid'])
430369
def getTestSuiteByID(self):
431-
""" getTestSuiteByID : Return a TestSuite by ID
432-
433-
positional args: testsuiteid
434-
optional args : --- """
435-
370+
""" Return a TestSuite by ID """
436371

437372
@decoMakerApiCallReplaceTLResponseError()
438373
@decoApiCallAddDevKey
439374
@decoMakerApiCallWithArgs(['testsuiteid'])
440375
def getTestSuitesForTestSuite(self):
441-
""" getTestSuitesForTestSuite : get list of TestSuites which are DIRECT
442-
children of a given TestSuite
443-
positional args: testsuiteid
444-
optional args : ---
376+
""" get list of TestSuites which are DIRECT children of a given TestSuite
445377
446378
returns an empty list, if no platform is assigned """
447379

448380
@decoMakerApiCallReplaceTLResponseError(3041)
449381
@decoApiCallAddDevKey
450382
@decoMakerApiCallWithArgs(['testplanid'])
451383
def getTestPlanPlatforms(self):
452-
""" getTestPlanPlatforms : Returns the list of platforms associated to
453-
a given test plan
454-
positional args: testplanid
455-
optional args : ---
384+
""" Returns the list of platforms associated to a given test plan
456385
457386
returns an empty list, if no platform is assigned (api error 3041)
458387
- details see comments for decoMakerApiCallReplaceTLResponseError """
459388

460389
@decoApiCallAddDevKey
461390
@decoMakerApiCallWithArgs(['testplanid'])
462391
def getTotalsForTestPlan(self):
463-
""" getTotalsForTestPlan : Gets the summarized results grouped by platform.
464-
positional args: testplanid
465-
optional args : --- """
392+
""" Gets the summarized results grouped by platform. """
466393

467394
@decoMakerApiCallWithArgs(['user'])
468395
def doesUserExist(self):
469-
""" doesUserExist : Checks if user name exists
470-
positional args: user
471-
optional args : ---
396+
""" Checks if user name exists
472397
returns true if everything OK, otherwise error structure """
473398

474399
@decoApiCallAddDevKey
475400
@decoMakerApiCallWithArgs(['devKey'])
476401
def checkDevKey(self):
477-
""" checkDevKey : check if Developer Key exists
478-
positional args: ---
479-
optional args : ---
402+
""" check if Developer Key exists
480403
returns true if everything OK, otherwise error structure """
481404

482405
# /**
@@ -589,10 +512,8 @@ def checkDevKey(self):
589512
@decoMakerApiCallWithArgs(['executionid'],
590513
['title', 'description', 'filename', 'filetype', 'content'])
591514
def uploadExecutionAttachment(self):
592-
""" uploadExecutionAttachment: Uploads an attachment for an execution
593-
mandatory args: attachmentfile
594-
positional args: executionid
595-
optional args : title, description, filename, filetype, content
515+
""" Uploads an attachment for an execution
516+
mandatory non api args: attachmentfile
596517
597518
attachmentfile: python file descriptor pointing to the file
598519
!Attention - on WINDOWS use binary mode for none text file

Diff for: src/testlink/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
#
1818
# ------------------------------------------------------------------------
1919

20-
VERSION = '0.4.5-RC1-dev'
20+
VERSION = '0.4.5-RC1'

0 commit comments

Comments
 (0)