Skip to content

Commit 4919feb

Browse files
author
Luiko Czub
committed
new api method setTestCaseExecutionType() #14
1 parent 56ce042 commit 4919feb

File tree

6 files changed

+35
-0
lines changed

6 files changed

+35
-0
lines changed

Diff for: CHANGES.rst

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ new TestlinkAPIGeneric and TestlinkAPIClient api methods
2121

2222
- getUserByLogin(), getUserByID()
2323
- deleteExecution()
24+
- setTestCaseExecutionType()
2425

2526
TestLink-API-Python-client release notes v0.4.7 (Jan. 2014)
2627
-----------------------------------------------------------

Diff for: example/TestLinkExample.py

+8
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,14 @@
484484
# sh..: another problem occurs
485485
raise
486486

487+
# now we try to change the execution types of the test cases
488+
# - AA from manual -> auto and B from auto -> manual
489+
newResult = myTestLink.setTestCaseExecutionType(tc_aa_full_ext_id, tc_version,
490+
newProjectID, AUTOMATED)
491+
print "setTestCaseExecutionType", response
492+
newResult = myTestLink.setTestCaseExecutionType(tc_b_full_ext_id, tc_version,
493+
newProjectID, MANUAL)
494+
print "setTestCaseExecutionType", response
487495

488496
# get information - TestProject
489497
response = myTestLink.getTestProjectByName(NEWPROJECT)

Diff for: example/TestLinkExampleGenericApi.py

+9
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,15 @@
411411
# sh..: another problem occurs
412412
raise
413413

414+
# now we try to change the execution types of the test cases
415+
# - AA from manual -> auto and B from auto -> manual
416+
newResult = myTestLink.setTestCaseExecutionType(tc_aa_full_ext_id, tc_version,
417+
newProjectID, AUTOMATED)
418+
print "setTestCaseExecutionType", response
419+
newResult = myTestLink.setTestCaseExecutionType(tc_b_full_ext_id, tc_version,
420+
newProjectID, MANUAL)
421+
print "setTestCaseExecutionType", response
422+
414423
# get information - TestProject
415424
response = myTestLink.getTestProjectByName(NEWPROJECT)
416425
print "getTestProjectByName", response

Diff for: src/testlink/testlinkapigeneric.py

+9
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,15 @@ def deleteTestCaseSteps(self):
790790
# */
791791
# public function setTestCaseExecutionType($args)
792792

793+
@decoApiCallAddDevKey
794+
@decoMakerApiCallWithArgs(['testcaseexternalid', 'version', 'testprojectid',
795+
'executiontype'])
796+
def setTestCaseExecutionType(self):
797+
""" Update execution type for a test case version
798+
799+
possible executiontype values
800+
1 = TESTCASE_EXECUTION_TYPE_MANUAL, 2 = TESTCASE_EXECUTION_TYPE_AUTO """
801+
793802
# /**
794803
# *
795804
# */

Diff for: test/utest-online/testlinkapi_online_test.py

+4
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ def test_deleteExecution_unknownKey(self):
278278
# Expects: 232: Configuration does not allow delete executions
279279
self.assertEqual(232, tl_err.code)
280280

281+
def test_setTestCaseExecutionType_unknownID(self):
282+
with self.assertRaisesRegexp(TLResponseError, '7000.*4712'):
283+
self.client.setTestCaseExecutionType('N-4711', 1, 4712, 1)
284+
281285

282286
if __name__ == "__main__":
283287
#import sys;sys.argv = ['', 'Test.testName']

Diff for: test/utest-online/testlinkapigeneric_online_test.py

+4
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ def test_deleteExecution_unknownKey(self):
294294
# case: TL configuration does not allow deletion of executions
295295
# Expects: 232: Configuration does not allow delete executions
296296
self.assertEqual(232, tl_err.code)
297+
298+
def test_setTestCaseExecutionType_unknownID(self):
299+
with self.assertRaisesRegexp(TLResponseError, '7000.*4712'):
300+
self.client.setTestCaseExecutionType('N-4711', 1, 4712, 1)
297301

298302

299303
if __name__ == "__main__":

0 commit comments

Comments
 (0)