Skip to content

Commit 2e7434a

Browse files
author
Luiko Czub
committed
Merge branch 'master' with Py3 changes into proxy #38
Conflicts: CHANGES.rst README.rst src/testlink/testlinkhelper.py src/testlink/version.py
2 parents cf7e506 + 76ef026 commit 2e7434a

27 files changed

+877
-537
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.tox
2+
.idea
13
.project
24
.pydevproject
35
.settings/

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
language: python
2+
python:
3+
- "2.6"
4+
- "2.7"
5+
- "3.3"
6+
- "3.4"
7+
8+
# command to install dependencies
9+
install:
10+
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2; fi
11+
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install argparse; fi
12+
- pip install .
13+
14+
# command to run tests
15+
script: py.test test/utest-offline

CHANGES.rst

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

4-
PreRelease TestLink-API-Python-client with proxy support
5-
--------------------------------------------------------
4+
TestLink-API-Python-client v0.6.1 - Under Develop
5+
------------------------------------------------------------
66

7-
Pull Request - Proxy configuration support in TestLinkHelper #36
7+
Proxy configuration support in TestLinkHelper - pull request #36
88
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99

10-
Pull Request from Maberi allows proxy configuration using TestLinkHelper.
10+
Integrates `Maberi <https://github.com/Maberi/TestLink-API-Python-client>`_
11+
pull request `#36 <https://github.com/lczub/TestLink-API-Python-client/pull/36>`_
1112

12-
Adds a new --proxy option in command line.
13-
Recognizes "http_proxy" environment variable.
13+
- allows easy proxy configuration using TestLinkHelper
14+
- Adds a new --proxy option in command line.
15+
- Recognizes "http_proxy" environment variable.
1416

1517

16-
TestLink-API-Python-client release notes v0.5.2 (Oct. 2014)
18+
TestLink-API-Python-client release notes v0.6.0 (Dec. 2014)
19+
------------------------------------------------------------
20+
21+
support for TestLink release 1.9.12 and py26, py27, py33 and py34
22+
23+
python 3 support - pull requests #33 #37
24+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25+
26+
Integrates `manojklm <https://github.com/manojklm/TestLink-API-Python-client>`_
27+
pull requests
28+
`#33 <https://github.com/lczub/TestLink-API-Python-client/pull/33>`_
29+
and `#37 <https://github.com/lczub/TestLink-API-Python-client/pull/37>`_
30+
31+
- add source and unittest support for py33 and py34
32+
- extend py26 support for unittest2
33+
- add *.travis.yml* configuration for `Travis CI <http://docs.travis-ci.com/>`_
34+
- add *tox.ini* configuration for `Tox <http://tox.readthedocs.org>`_
35+
36+
Track now TestLink-API-Python-client build results on Travis CI - see
37+
https://travis-ci.org/lczub/TestLink-API-Python-client
38+
39+
extend upload attachments - handling file path #40
40+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41+
42+
uploading attachments excepts now also a file path as parameter.
43+
44+
still supported 0.5.2 behavior - file descriptor::
45+
46+
a_file_obj=open(A_VALID_FILE_PATH)
47+
newAttachment = myTestLink.uploadExecutionAttachment(a_file_obj, A_Result_ID,
48+
'Attachment Title', 'Attachment Description')
49+
50+
new supported 0.6.0 behaviour - file path::
51+
52+
a_file_path=A_VALID_FILE_PATH
53+
newAttachment = myTestLink.uploadExecutionAttachment(a_file_path, A_Result_ID,
54+
'Attachment Title', 'Attachment Description')
55+
56+
TestLink-API-Python-client release notes v0.5.2 (Oct. 2014)
1757
-----------------------------------------------------------
1858
support for TestLink release 1.9.12
1959

@@ -29,7 +69,7 @@ new TestlinkAPIGeneric and TestlinkAPIClient api method
2969
examples see `<example/TestLinkExample.py>`_
3070

3171
implement 1.9.12 new api method - getTestCaseBugs #30
32-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3373

3474
new TestlinkAPIGeneric and TestlinkAPIClient api method
3575

@@ -41,11 +81,11 @@ new TestlinkAPIGeneric and TestlinkAPIClient api method
4181
examples see `<example/TestLinkExample.py>`_
4282

4383
TestLink-API-Python-client release notes v0.5.1 (Aug. 2014)
44-
------------------------------------------------------------
84+
-----------------------------------------------------------
4585
support for TestLink release 1.9.11
4686

4787
implement 1.9.11 api change - getLastExecutionResult #27
48-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4989

5090
TestlinkAPIGeneric and TestlinkAPIClient api method getLastExecutionResult()
5191
accepts now following additional optional arguments
@@ -59,7 +99,7 @@ example:
5999
[{ ... , 'tcversion_id': '8929', ... , 'bugs': [{'bug_id': '4711'}], ... }]
60100

61101
implement 1.9.11 new api method - assignTestCaseExecutionTask #26
62-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
102+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63103

64104
new TestlinkAPIGeneric and TestlinkAPIClient api method
65105

@@ -71,7 +111,7 @@ examples see `<example/TestLinkExample.py>`_
71111

72112

73113
TestLink-API-Python-client release notes v0.5.0 (Jul. 2014)
74-
------------------------------------------------------------
114+
-----------------------------------------------------------
75115
support for TestLink release 1.9.10
76116

77117
new service methods - list keywords #25
@@ -111,7 +151,7 @@ accepts now following additional optional arguments (usable with TL >= 1.9.10)
111151
- parameter getkeywords
112152

113153
implement 1.9.10 api change - reportTCResult #24
114-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115155

116156
TestlinkAPIGeneric and TestlinkAPIClient api method reportTCResult()
117157
accepts now following additional optional arguments (usable with TL >= 1.9.10)
@@ -120,7 +160,7 @@ accepts now following additional optional arguments (usable with TL >= 1.9.10)
120160

121161

122162
implement missing 1.9.8 api method - CustomField #12
123-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
163+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
124164

125165
new TestlinkAPIGeneric and TestlinkAPIClient api methods
126166

@@ -167,7 +207,7 @@ new TestlinkAPIGeneric and TestlinkAPIClient service method to return connection
167207
- connectionInfo()
168208

169209
implement missing 1.9.8 api method - miscellaneous #14
170-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
210+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171211

172212
new TestlinkAPIGeneric and TestlinkAPIClient api methods
173213

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include MANIFEST.in LICENSE-2.0.txt README.rst CHANGES.rst
1+
include MANIFEST.in LICENSE-2.0.txt README.rst CHANGES.rst tox.ini
22
recursive-include src *.py
33
recursive-include example *.py
44
recursive-include example *.png

README.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ James Stock, Olivier Renault, Luiko Czub, TestLink-API-Python-client developers
66

77
License `Apache License 2.0`_
88

9+
.. image:: https://travis-ci.org/lczub/TestLink-API-Python-client.svg?branch=proxy
10+
:target: https://travis-ci.org/lczub/TestLink-API-Python-client
11+
12+
.. contents::
13+
:local:
14+
915
Introduction
1016
------------
1117

@@ -69,6 +75,10 @@ examples/
6975

7076
tests/
7177
Unit Tests for TestLink API Python Client
78+
79+
`tox.ini`_
80+
Configuration for multi Python version testing via `Tox`_
81+
7282

7383
Help
7484
----
@@ -81,7 +91,7 @@ how existing code can be adapted
8191

8292
TestLink-API-Python-client developers
8393
-------------------------------------
84-
* `James Stock`_, `Olivier Renault`_, `lczub`_
94+
* `James Stock`_, `Olivier Renault`_, `lczub`_, `manojklm`_ (PY3)
8595
* `g4l4drim`_, `pade`_, `anton-matosov`_, `citizen-stig`_, `charz`_, `Maberi`_
8696
* anyone forgotten?
8797

@@ -94,6 +104,8 @@ TestLink-API-Python-client developers
94104
.. _Usage: doc/usage.rst
95105
.. _TestlinkAPIGeneric: example/TestLinkExampleGenericApi.py
96106
.. _TestlinkAPIClient: example/TestLinkExample.py
107+
.. _tox.ini: tox.ini
108+
.. _Tox: http://tox.readthedocs.org/en/latest/
97109
.. _Issues: https://github.com/lczub/TestLink-API-Python-client/issues
98110
.. _Olivier Renault: https://github.com/orenault/TestLink-API-Python-client
99111
.. _pade: https://github.com/pade/TestLink-API-Python-client
@@ -103,4 +115,5 @@ TestLink-API-Python-client developers
103115
.. _anton-matosov: https://github.com/anton-matosov/TestLink-API-Python-client
104116
.. _citizen-stig: https://github.com/citizen-stig/TestLink-API-Python-client
105117
.. _charz: https://github.com/charz/TestLink-API-Python-client.git
106-
.. _Maberi: https://github.com/Maberi/TestLink-API-Python-client.git
118+
.. _manojklm: https://github.com/manojklm/TestLink-API-Python-client
119+
.. _Maberi: https://github.com/Maberi/TestLink-API-Python-client.git

doc/install.rst

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
TestLink-API-Python-client Installation
22
=======================================
33

4+
.. contents::
5+
:local:
6+
47
Preconditions
58
-------------
69

7-
Currently the combinations Python 2.6.6/2.7.8 and TestLink 1.9.12 are tested.
10+
Currently the combinations Python 2.6.9/2.7.9/3.3.5/3.4.2 and TestLink 1.9.12 are tested.
811

912
- Other combination might work - feedback is welcome :-)
1013

1114
To use TestLink-API-Python-client under Py26, the module **argparse** must be
12-
installed additionally (Py27 already includes this)::
15+
installed additionally (Py27, Py33 and Py34 already includes this)::
1316

1417
pip install argparse
1518

@@ -66,21 +69,21 @@ Check, if Python could talk with TestLink using the connection parameter
6669
as init parameter::
6770

6871
python
69-
>>> import testlink
70-
>>> tls = testlink.TestlinkAPIClient(SERVER_URL, DEVKEY)
71-
>>> tls.about()
72-
' Testlink API Version: 1.0 initially ....'
73-
74-
or by defining the connection parameter as environment variables::
75-
72+
>>> import testlink
73+
>>> tls = testlink.TestlinkAPIClient(SERVER_URL, DEVKEY)
74+
>>> tls.about()
75+
' Testlink API Version: 1.0 initially ....'
76+
77+
or by defining the connection parameter as environment variables::
78+
7679
set TESTLINK_API_PYTHON_SERVER_URL=http://[YOURSERVER]/testlink/lib/api/xmlrpc/v1/xmlrpc.php
7780
set TESTLINK_API_PYTHON_DEVKEY=[Users devKey generated by TestLink]
7881
python
79-
>>> import testlink
80-
>>> tls = testlink.TestLinkHelper(testlink.TestlinkAPIClient)
81-
>>> tls.about()
82-
' Testlink API Version: 1.0 initially ....'
83-
82+
>>> import testlink
83+
>>> tls = testlink.TestLinkHelper(testlink.TestlinkAPIClient)
84+
>>> tls.about()
85+
' Testlink API Version: 1.0 initially ....'
86+
8487
Changed SERVER_URL with TestLink 1.9.7
8588
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8689

@@ -108,7 +111,7 @@ with connection parameter as environment variables
108111
- TESTLINK_API_PYTHON_SERVER_URL and TESTLINK_API_PYTHON_DEVKEY
109112

110113

111-
114+
112115
.. _PyPI: https://pypi.python.org/pypi
113116
.. _pip: http://www.pip-installer.org
114117
.. _SourceForge: http://sourceforge.net/projects/testlink-api-python-client/files/latest/download

doc/usage.rst

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
TestLink-API-Python-client Usage
22
================================
33

4+
.. contents::
5+
:local:
6+
47
How to talk with TestLink in a python shell
58
-------------------------------------------
69

@@ -33,7 +36,7 @@ or generate a description of all implemented API method: ::
3336
tlh = testlink.TestLinkHelper()
3437
tls = tlh.connect(testlink.TestlinkAPIClient)
3538
for m in testlink.testlinkargs._apiMethodsArgs.keys():
36-
print tls.whatArgs(m), '\n'
39+
print(tls.whatArgs(m), '\n')
3740

3841
Copy test cases
3942
---------------
@@ -97,10 +100,28 @@ alternative optional args, default reporter (user for devKey)
97100
>>> tls = testlink.TestLinkHelper().connect(testlink.TestlinkAPIGeneric)
98101
>>> exTCID = tls.getTestCase(testcaseid=a_TestCaseID)[0]['full_tc_external_id']
99102
>>> tls.reportTCResult(a_TestPlanID, 'b', testcaseexternalid=exTCID,
100-
buildid='a build name', platformname='a platform name')
103+
buildid='a build name', platformname='a platform name')
101104

105+
Upload attachments
106+
------------------
107+
108+
uploading attachments can be done in two different ways
109+
110+
with a file descriptor::
111+
112+
a_file_obj=open(A_VALID_FILE_PATH)
113+
newAttachment = myTestLink.uploadExecutionAttachment(a_file_obj, A_Result_ID,
114+
'Attachment Title', 'Attachment Description')
115+
116+
117+
with a file path::
118+
119+
a_file_path=A_VALID_FILE_PATH
120+
newAttachment = myTestLink.uploadExecutionAttachment(a_file_path, A_Result_ID,
121+
'Attachment Title', 'Attachment Description')
122+
102123
List keywords
103-
-------------------
124+
-------------
104125

105126
Using the api method - keywords for all test cases of one test suite
106127

@@ -141,6 +162,9 @@ parameter defined as environment variables [2]_: ::
141162
set TESTLINK_API_PYTHON_SERVER_URL=http://[YOURSERVER]/testlink/lib/api/xmlrpc/v1/xmlrpc.php
142163
set TESTLINK_API_PYTHON_DEVKEY=[Users devKey generated by TestLink]
143164
python example\TestLinkExampleGenericApi.py
165+
166+
.. [1] TestLinkExample.py creates a new test project NEW_PROJECT_API-[CountProjects+1].
167+
.. [2] TestLinkExampleGenericApi.py creates a new test project PROJECT_API_GENERIC-[CountProjects+1].
144168
145169
Run unittests
146170
-------------
@@ -158,6 +182,8 @@ Run unittests without TestLink Server interaction: ::
158182
[PYENV]\testlink\Scripts\activate
159183
cd test\utest
160184
python -m unittest discover -s test\utest-offline
185+
186+
Under Py26, unittest2_ must be used.
187+
188+
.. _unittest2: https://pypi.python.org/pypi/unittest2
161189

162-
.. [1] TestLinkExample.py creates a new test project NEW_PROJECT_API-[CountProjects+1].
163-
.. [2] TestLinkExampleGenericApi.py creates a new test project PROJECT_API_GENERIC-[CountProjects+1].

example/Last7DaysTestCases.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# which have been created during the last 7 days
2222

2323

24+
from __future__ import print_function
2425
from testlink import TestlinkAPIClient, TestLinkHelper
2526
import time
2627

@@ -45,8 +46,8 @@ def iterTCasesfromTProject(api, TProjName, date1, date2):
4546
currentTime = time.localtime()
4647
oldTime = time.localtime(time.time() - 3600 * 24 * 7)
4748

48-
print '%s test cases created between %s and %s' % \
49+
print('%s test cases created between %s and %s' % \
4950
(projName, time.strftime('%Y-%m-%d', oldTime),
50-
time.strftime('%Y-%m-%d', currentTime))
51+
time.strftime('%Y-%m-%d', currentTime)))
5152
for TCdata in iterTCasesfromTProject(tlapi, projName, oldTime, currentTime):
52-
print ' %(name)s %(version)s %(creation_ts)s' % TCdata
53+
print(' %(name)s %(version)s %(creation_ts)s' % TCdata)

0 commit comments

Comments
 (0)