Skip to content

Commit b941002

Browse files
author
Luiko Czub
committed
new api method - updateBuildCustomFieldsValues #80
1 parent 7c178cb commit b941002

8 files changed

+120
-28
lines changed

CHANGES.rst

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
11
Changes in TestLink-API-Python-client Source Distribution
22
=========================================================
33

4-
TestLink-API-Python-client release notes v0.6.3 (Nov. 2016)
5-
------------------------------------------------------------
4+
TestLink-API-Python-client v0.6.4 - Under Develop
5+
-------------------------------------------------
6+
support for TL 1.9.16 release and py27, py34 and py35
7+
8+
implement 1.9.16 new api interfaces - #80
9+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10+
11+
new TestlinkAPIGeneric and TestlinkAPIClient api method
12+
13+
- updateBuildCustomFieldsValues(<testprojectid>, <testplanid>, <buildid>,
14+
<customfields>, [devKey=<devKey>])
15+
16+
example `<example/TestLinkExample_CF_KW.py>`_ shows, how to set and get
17+
customer field values
18+
19+
TestLink-API-Python-client release notes v0.6.3 (Nov. 2016)
20+
-----------------------------------------------------------
621
support for TL 1.9.15 release and py26, py27, py33, py34 and py35
722

823
- further releases will be developed only against py27, py34 and py35
924
- If there is a need to support other py versions, please give feedback
1025

1126
implement 1.9.15 new api interfaces - #54 #67 #69
12-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1328

1429
new TestlinkAPIGeneric and TestlinkAPIClient api methods
1530

@@ -20,7 +35,7 @@ new TestlinkAPIGeneric and TestlinkAPIClient api methods
2035
- getIssueTrackerSystem(<itsname>, [devKey=<devKey>])
2136

2237
implement 1.9.15 changed api interfaces - #68 #70 #72 #71 #69
23-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2439

2540
changed TestlinkAPIGeneric and TestlinkAPIClient api methods
2641

@@ -57,7 +72,7 @@ examples:
5772

5873

5974
known TL 1.9.15 issues:
60-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75+
~~~~~~~~~~~~~~~~~~~~~~~
6176

6277
changing test suite order with updateTestSuite raise internal server error
6378

@@ -73,15 +88,15 @@ TestLink web presents no login page (internal server error)
7388
Test projects with execution step results can not be deleted
7489
- details and solution see `TL Mantis Ticket 7765 <http://mantis.testlink.org/view.php?id=7765>`_
7590

76-
TestLink-API-Python-client v0.6.2 release notes v0.6.2 (Oct. 2015)
77-
-------------------------------------------------------------------
91+
TestLink-API-Python-client v0.6.2 release notes v0.6.2 (Oct. 2015)
92+
------------------------------------------------------------------
7893
support for TL 1.9.14 release and py26, py27, py33 and py34
7994

8095
- further releases will be developed only against py27 and py34.
8196
- If there is a need to support other py versions, please give feedback
8297

8398
implement 1.9.14 new api interfaces - #53 #61
84-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85100

86101
new TestlinkAPIGeneric and TestlinkAPIClient api methods
87102

@@ -96,7 +111,7 @@ example `<example/TestLinkExample_CF_KW.py>`_ shows, how to set and get
96111
customer field values
97112

98113
implement 1.9.14 changed api interfaces - #48 #49 #54 #59
99-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
114+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
100115

101116
changed TestlinkAPIGeneric and TestlinkAPIClient api methods
102117

@@ -133,7 +148,7 @@ a different error code
133148
- 1.9.13 error code *5000* - 1.9.14 error code *5040*
134149

135150
Bugfixes TestLink-API-Python-client v0.6.1 - #51 #55 #56 #45
136-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
151+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137152

138153
whatArgs reports incorrect arg name for createTestCase
139154

@@ -159,11 +174,11 @@ Known TL 1.9.14 limitations:
159174

160175
- 7282 updateTestSuiteCustomFieldDesignValue() does change customer field values
161176

162-
TestLink-API-Python-client release notes v0.6.1 (Mar. 2015)
163-
------------------------------------------------------------
177+
TestLink-API-Python-client release notes v0.6.1 (Mar. 2015)
178+
-----------------------------------------------------------
164179
support for TL 1.9.13 release
165180

166-
Proxy configuration support in TestLinkHelper - pull request #36
181+
Proxy configuration support in TestLinkHelper - pull request #36
167182
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168183

169184
Integrates `Maberi <https://github.com/Maberi/TestLink-API-Python-client>`_
@@ -174,7 +189,7 @@ pull request `#36 <https://github.com/lczub/TestLink-API-Python-client/pull/36>`
174189
- Recognizes "http_proxy" environment variable.
175190

176191
implement 1.9.13 new api methods #32 #41 #42 #44 #47 #46
177-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
178193

179194
new TestlinkAPIGeneric and TestlinkAPIClient api methods
180195

@@ -202,7 +217,7 @@ new TestlinkAPIGeneric and TestlinkAPIClient api methods
202217
examples see `<example/TestLinkExample.py>`_ and `<example/TestLinkExample_CF_KW.py>`_
203218

204219
implement 1.9.13 api change - getTestCasesForTestPlan #41
205-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
220+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
206221

207222
TestlinkAPIGeneric and TestlinkAPIClient api method getTestCasesForTestPlan()
208223
accepts now the additional optional argument platformid=<platformid>
@@ -216,13 +231,13 @@ example:
216231
Also the optional argument buildid=<buildid> could now be used
217232

218233

219-
TestLink-API-Python-client release notes v0.6.0 (Dec. 2014)
220-
------------------------------------------------------------
234+
TestLink-API-Python-client release notes v0.6.0 (Dec. 2014)
235+
-----------------------------------------------------------
221236

222237
support for TestLink release 1.9.12 and py26, py27, py33 and py34
223238

224239
python 3 support - pull requests #33 #37
225-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
240+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
226241

227242
Integrates `manojklm <https://github.com/manojklm/TestLink-API-Python-client>`_
228243
pull requests
@@ -281,7 +296,7 @@ new TestlinkAPIGeneric and TestlinkAPIClient api method
281296

282297
examples see `<example/TestLinkExample.py>`_
283298

284-
TestLink-API-Python-client release notes v0.5.1 (Aug. 2014)
299+
TestLink-API-Python-client release notes v0.5.1 (Aug. 2014)
285300
-----------------------------------------------------------
286301
support for TestLink release 1.9.11
287302

@@ -311,7 +326,7 @@ new TestlinkAPIGeneric and TestlinkAPIClient api method
311326
examples see `<example/TestLinkExample.py>`_
312327

313328

314-
TestLink-API-Python-client release notes v0.5.0 (Jul. 2014)
329+
TestLink-API-Python-client release notes v0.5.0 (Jul. 2014)
315330
-----------------------------------------------------------
316331
support for TestLink release 1.9.10
317332

@@ -511,7 +526,7 @@ Other API methods can be used with the new method
511526

512527
- callServerWithPosArgs(apiMethodame, [apiArgName=apiArgValue])
513528

514-
generic api class TestlinkAPIGeneric #7
529+
generic api class TestlinkAPIGeneric #7
515530
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
516531
new class TestlinkAPIGeneric implements the Testlink API methods as generic PY methods
517532

example/TestLinkExample_CF_KW.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@
238238
'testsuiteid': newTestSuiteID_B,
239239
'testplanid': lastResult['testplan_id'],
240240
'reqspecid': 7789,
241-
'requirementid': 7791}
241+
'requirementid': 7791,
242+
'buildid':newBuildID_A}
242243

243244
# get CustomField Value - TestCase Execution
244245
response = myTestLink.getTestCaseCustomFieldExecutionValue(
@@ -303,3 +304,11 @@
303304
response = myTestLink.getRequirementCustomFieldDesignValue(
304305
'cf_req_string',args['testprojectid'], args['requirementid'])
305306
print( "getRequirementCustomFieldDesignValue", response )
307+
308+
# update CustomField Value - Build
309+
response = myTestLink.updateBuildCustomFieldsValues(
310+
args['testprojectid'], args['testplanid'], args['buildid'],
311+
{'cf_b_string' : 'A custom Build value set via api'})
312+
print( "updateBuildCustomFieldsValues", response )
313+
314+

example/customFields_ExampleDefs.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,21 @@
136136
<enable_on_testplan_design><![CDATA[0]]></enable_on_testplan_design>
137137
<node_type_id><![CDATA[7]]></node_type_id>
138138
</custom_field>
139+
<custom_field>
140+
<name><![CDATA[cf_b_string]]></name>
141+
<label><![CDATA[CF_Build String]]></label>
142+
<type><![CDATA[0]]></type>
143+
<possible_values><![CDATA[]]></possible_values>
144+
<default_value><![CDATA[default value Build]]></default_value>
145+
<valid_regexp><![CDATA[]]></valid_regexp>
146+
<length_min><![CDATA[0]]></length_min>
147+
<length_max><![CDATA[0]]></length_max>
148+
<show_on_design><![CDATA[1]]></show_on_design>
149+
<enable_on_design><![CDATA[1]]></enable_on_design>
150+
<show_on_execution><![CDATA[1]]></show_on_execution>
151+
<enable_on_execution><![CDATA[0]]></enable_on_execution>
152+
<show_on_testplan_design><![CDATA[0]]></show_on_testplan_design>
153+
<enable_on_testplan_design><![CDATA[0]]></enable_on_testplan_design>
154+
<node_type_id><![CDATA[12]]></node_type_id>
155+
</custom_field>
139156
</custom_fields>

src/testlink/testlinkapigeneric.py

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,8 +1638,8 @@ def deleteTestProject(self):
16381638
def updateTestSuiteCustomFieldDesignValue(self):
16391639
""" Update value of Custom Field with scope='design' for a given Test Suite
16401640
1641-
customfields : dictionary with customfields names + values
1642-
VERY IMPORTANT: value must be formatted in the way it's written to db
1641+
customfields : dictionary with customfields names + values
1642+
VERY IMPORTANT: value must be formatted in the way it's written to db
16431643
"""
16441644

16451645
# /**
@@ -1713,6 +1713,44 @@ def updateTestSuite(self):
17131713
def getIssueTrackerSystem(self):
17141714
""" Get Issue Tracker System by name """
17151715

1716+
# /**
1717+
# * Update value of Custom Field with scope='design'
1718+
# * for a given Build
1719+
# *
1720+
# * @param struct $args
1721+
# * @param string $args["devKey"]: used to check if operation can be done.
1722+
# * if devKey is not valid => abort.
1723+
# *
1724+
# * @param string $args["buildid"]:
1725+
# * @param string $args["testprojectid"]:
1726+
# * @param string $args["customfields"]
1727+
# * contains an map with key:Custom Field Name, value: value for CF.
1728+
# * VERY IMPORTANT: value must be formatted in the way it's written to db,
1729+
# * this is important for types like:
1730+
# *
1731+
# * DATE: strtotime()
1732+
# * DATETIME: mktime()
1733+
# * MULTISELECTION LIST / CHECKBOX / RADIO: se multipli selezione ! come separatore
1734+
# *
1735+
# *
1736+
# * these custom fields must be configured to be writte during execution.
1737+
# * If custom field do not meet condition value will not be written
1738+
# *
1739+
# * @return mixed null if everything ok, else array of IXR_Error objects
1740+
# *
1741+
# * @access public
1742+
# */
1743+
# public function updateBuildCustomFieldsValues($args)
1744+
1745+
@decoApiCallAddDevKey
1746+
@decoMakerApiCallWithArgs(['testprojectid', 'testplanid', 'buildid',
1747+
'customfields'])
1748+
def updateBuildCustomFieldsValues(self):
1749+
""" Update value of Custom Field with scope='design' for a given Build
1750+
1751+
customfields : dictionary with customfields names + values
1752+
VERY IMPORTANT: value must be formatted in the way it's written to db
1753+
"""
17161754

17171755
#
17181756
# internal methods for general server calls

src/testlink/testlinkhelper.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,9 @@ def _getProxiedTransport(self):
133133
a_pt.set_proxy(self._proxy)
134134
return a_pt
135135

136-
def connect(self, tl_api_class):
136+
def connect(self, tl_api_class, **kwargs):
137137
""" returns a new instance of TL_API_CLASS """
138138

139-
kwargs = {}
140139
if self._proxy:
141140
kwargs['transport'] = self._getProxiedTransport()
142141

src/testlink/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
#
1818
# ------------------------------------------------------------------------
1919

20-
VERSION = '0.6.3'
21-
TL_RELEASE = '1.9.15'
20+
VERSION = '0.6.4-dev080'
21+
TL_RELEASE = '1.9.16'
2222

test/utest-online/testlinkapi_generic_online_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,12 @@ def test_getIssueTrackerSystem_unknownITS(self):
462462
with self.assertRaisesRegex(TLResponseError, '13000.*Unable to find'):
463463
self.client.getIssueTrackerSystem('unknownITS')
464464

465+
def test_updateBuildCustomFieldsValues_unknownID(self):
466+
with self.assertRaisesRegex(TLResponseError, '7000.*40000712'):
467+
self.client.updateBuildCustomFieldsValues(
468+
'40000712 project', '40000713 plan', '40000714 build',
469+
{'cf_b_ex_string' : 'a custom exec value',
470+
'cf_b_ex_numeric' : 111} )
465471

466472

467473
if __name__ == "__main__":

test/utest-online/testlinkapi_online_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,14 @@ def test_updateTestSuite_unknownID(self):
447447
def test_getIssueTrackerSystem_unknownITS(self):
448448
with self.assertRaisesRegex(TLResponseError, '13000.*Unable to find'):
449449
self.client.getIssueTrackerSystem('unknownITS')
450+
451+
def test_updateBuildCustomFieldsValues_unknownID(self):
452+
with self.assertRaisesRegex(TLResponseError, '7000.*40000712'):
453+
self.client.updateBuildCustomFieldsValues(
454+
'40000712 project', '40000713 plan', '40000714 build',
455+
{'cf_b_ex_string' : 'a custom exec value',
456+
'cf_b_ex_numeric' : 111} )
457+
450458

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

0 commit comments

Comments
 (0)