Skip to content

Latest commit

 

History

History
120 lines (78 loc) · 3.71 KB

install.rst

File metadata and controls

120 lines (78 loc) · 3.71 KB

TestLink-API-Python-client Installation

Currently the combinations Python 2.7.13/3.4.4/3.5.3/3.6.1 are tested with TestLink 1.9.16. Other combination might work - feedback is welcome :-)

The TestLink configuration (config.inc.php or custom_config.inc.php) must have enabled the api interface:

$tlCfg->api->enabled = TRUE;

Create the user specific devKey inside TestLink, see

  • My Settings -> API interface - Personal API access key [Generate a new key]

TestLink-API-Python-client is available in the Python Package Index (PyPI) since Release v0.4.6. It is recommended that you use pip to install.

Install from PyPI using pip by running:

pip install TestLink-API-Python-client

The source code can be retrieved as source distribution either

Install the archives using pip by running:

pip install TestLink-API-Python-client-0.6.3.zip

Install the extracted source distribution or download of the last (none tested) changes from GitHup Master by running:

python setup.py install

Check, if Python could talk with TestLink using the connection parameter

as init parameter:

python
>>> import testlink
>>> tls = testlink.TestlinkAPIClient(SERVER_URL, DEVKEY)
>>> tls.about()
' Testlink API Version: 1.0 initially ....'

or by defining the connection parameter as environment variables:

set TESTLINK_API_PYTHON_SERVER_URL=http://[YOURSERVER]/testlink/lib/api/xmlrpc/v1/xmlrpc.php
set TESTLINK_API_PYTHON_DEVKEY=[Users devKey generated by TestLink]
python
>>> import testlink
>>> tls = testlink.TestLinkHelper(testlink.TestlinkAPIClient)
>>> tls.about()
' Testlink API Version: 1.0 initially ....'

The SERVER_URL path has changed with TestLink 1.9.7.

Cause most linux system (and although newer windows systems too) expect root privileges for installation, a separate TestLink virtualenv may help:

[PYTHON27]\Scripts\virtualenv [PYENV]\testlink
[PYENV]\testlink\Scripts\activate
pip install TestLink-API-Python-client

If you always work with the same TestLink server, extend the script

  • [PYENV]/testlink/Scripts/activate[.bat|.ps1]

with connection parameter as environment variables

  • TESTLINK_API_PYTHON_SERVER_URL and TESTLINK_API_PYTHON_DEVKEY

If the installation for the combination linux + py26 fails, maybe the workaround from issue 50 helps.