Skip to content

Commit 5001672

Browse files
author
Luiko Czub
committed
closeBuild samples and tests #131
1 parent 98b86f6 commit 5001672

File tree

6 files changed

+27
-4
lines changed

6 files changed

+27
-4
lines changed

example/TestLinkExample.py

+4
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,10 @@
578578
newBuildID_D = newBuild[0]['id']
579579
print("New Build '%s' - id: %s" % (NEWBUILD_D, newBuildID_D))
580580

581+
# close build A - buildid must be converted to an integer
582+
response = myTestLink.closeBuild( int(newBuildID_A) )
583+
print("closeBuild", response)
584+
581585
# get information - TestProject
582586
response = myTestLink.getTestProjectByName(NEWPROJECT)
583587
print("getTestProjectByName", response)

example/TestLinkExampleGenericApi.py

+4
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,10 @@
583583
newBuildID_D = newBuild[0]['id']
584584
print("New Build '%s' - id: %s" % (NEWBUILD_D, newBuildID_D))
585585

586+
# close build A - buildid must be converted to an integer
587+
response = myTestLink.closeBuild( int(newBuildID_A) )
588+
print("closeBuild", response)
589+
586590
# get information - TestProject
587591
response = myTestLink.getTestProjectByName(NEWPROJECT)
588592
print("getTestProjectByName", response)

src/testlink/testlinkapigeneric.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,12 @@ def createBuild(self):
190190
@decoApiCallAddDevKey
191191
@decoMakerApiCallWithArgs(['buildid'])
192192
def closeBuild(self):
193-
""" Close build """
193+
""" Close build
194+
195+
buildid - ATTENTION must be an integer
196+
- createBuild returns the id as a string
197+
- convert it with int() before calling closeBuild()
198+
"""
194199

195200
@decoMakerApiCallReplaceTLResponseError()
196201
@decoApiCallAddDevKey
@@ -716,6 +721,10 @@ def getFullPath(self):
716721
def deleteExecution(self):
717722
""" delete an execution
718723
724+
executionid - ATTENTION must be an integer
725+
- reportTCResult returns the id as a string
726+
- convert it with int() before calling deleteExecution()
727+
719728
Default TL server configuration does not allow deletion of exections
720729
see Installation & Configuration Manual Version 1.9
721730
chap. 5.8. Test execution settings

src/testlink/version.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
#
1818
# ------------------------------------------------------------------------
1919

20-
VERSION = '0.8.1'
21-
TL_RELEASE = 'DEV 1.9.20 (github a1c7aca97)'
20+
VERSION = '0.8.1-fix131'
21+
TL_RELEASE = '1.9.20-fixed'

test/utest-offline/test_apiClients_whatArgs.py

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def test_whatArgs_unknownMethods(api_client):
109109
'title=<title>', 'description=<description>',
110110
'filename=<filename>', 'filetype=<filetype>',
111111
'content=<content>']),
112+
('closeBuild', ['<buildid>'])
112113

113114
]
114115

test/utest-online/test_apiCall_equalPositionalArgs.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,12 @@ def test_getTestSuiteAttachments_unknownID(api_client):
462462
def test_getAllExecutionsResults_unknownID(api_client):
463463
with pytest.raises(TLResponseError, match='3000.*40000711'):
464464
api_client.getAllExecutionsResults(40000711)
465-
465+
466+
def test_closeBuild_unknownID(api_client):
467+
with pytest.raises(TLResponseError, match='4000.*40000713'):
468+
api_client.closeBuild(40000713)
469+
470+
466471
# if __name__ == "__main__":
467472
# #import sys;sys.argv = ['', 'Test.testName']
468473
# unittest.main()

0 commit comments

Comments
 (0)