|
| 1 | +TestLink-API-Python-client Installation |
| 2 | +======================================= |
| 3 | + |
| 4 | +Preconditions |
| 5 | +------------- |
| 6 | + |
| 7 | +Currently only the combination Python 2.7 and TestLink 1.9.8/1.9.9 is tested. |
| 8 | +Other combination might work - feedback is welcome :-) |
| 9 | + |
| 10 | +TestLink configuration |
| 11 | +---------------------- |
| 12 | + |
| 13 | +The TestLink configuration (config.inc.php or custom_config.inc.php) must have |
| 14 | +enabled the api interface |
| 15 | + |
| 16 | + $tlCfg->api->enabled = TRUE; |
| 17 | + |
| 18 | +Create the user specific devKey inside TestLink, see |
| 19 | + |
| 20 | +- My Settings -> API interface - Personal API access key [Generate a new key] |
| 21 | + |
| 22 | +Installing from PyPI |
| 23 | +-------------------- |
| 24 | + |
| 25 | +TestLink-API-Python-client will be available in the Python Package Index (PyPI_) |
| 26 | +with Release v0.4.6. It is recommended that you use `pip`_ to install. |
| 27 | + |
| 28 | +Install from PyPI using pip by running:: |
| 29 | + |
| 30 | + pip install TestLink-API-Python-client |
| 31 | + |
| 32 | +Installing from source distribution |
| 33 | +----------------------------------- |
| 34 | + |
| 35 | +The source code can be retrieved as source distribution either |
| 36 | + |
| 37 | +- as stable release from SourceForge_ |
| 38 | +- or as development version from `GitHup Releases`_ |
| 39 | + |
| 40 | +Install the archives using pip by running:: |
| 41 | + |
| 42 | + pip install TestLink-0.4.6.zip |
| 43 | + |
| 44 | +Installing from source |
| 45 | +---------------------- |
| 46 | + |
| 47 | +Install the extracted source distribution or download of the last (none tested) |
| 48 | +changes from `GitHup Master`_ by running:: |
| 49 | + |
| 50 | + python setup.py install |
| 51 | + |
| 52 | +Verifying Installation |
| 53 | +---------------------- |
| 54 | + |
| 55 | +Check, if Python could talk with TestLink using the connection parameter |
| 56 | + |
| 57 | +- SERVER_URL = 'http://[YOURSERVER]/testlink/lib/api/xmlrpc/v1/xmlrpc.php' |
| 58 | +- DEVKEY = '[Users devKey generated by TestLink]' |
| 59 | + |
| 60 | +as init parameter:: |
| 61 | + |
| 62 | + python |
| 63 | + >>> import testlink |
| 64 | + >>> tls = testlink.TestlinkAPIClient(SERVER_URL, DEVKEY) |
| 65 | + >>> tls.about() |
| 66 | + ' Testlink API Version: 1.0 initially ....' |
| 67 | + |
| 68 | +or by defining the connection parameter as environment variables:: |
| 69 | + |
| 70 | + set TESTLINK_API_PYTHON_SERVER_URL=http://[YOURSERVER]/testlink/lib/api/xmlrpc/v1/xmlrpc.php |
| 71 | + set TESTLINK_API_PYTHON_DEVKEY=[Users devKey generated by TestLink] |
| 72 | + python |
| 73 | + >>> import testlink |
| 74 | + >>> tls = testlink.TestLinkHelper(testlink.TestlinkAPIClient) |
| 75 | + >>> tls.about() |
| 76 | + ' Testlink API Version: 1.0 initially ....' |
| 77 | + |
| 78 | +Changed SERVER_URL with TestLink 1.9.7 |
| 79 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 80 | + |
| 81 | +The SERVER_URL path has changed with TestLink 1.9.7. |
| 82 | + |
| 83 | +- TL Version < 1.9.7: Use http://[YOURSERVER]/testlink/lib/api/xmlrpc.php |
| 84 | +- TL Version =>1.9.7: Use http://[YOURSERVER]/testlink/lib/api/xmlrpc/v1/xmlrpc.php |
| 85 | + |
| 86 | +Install in virtualenv TestLink |
| 87 | +------------------------------ |
| 88 | + |
| 89 | +Cause most linux system (and although newer windows systems too) expect root |
| 90 | +privileges for installation, a separate TestLink virtualenv_ may help:: |
| 91 | + |
| 92 | + [PYTHON27]\Scripts\virtualenv [PYENV]\testlink |
| 93 | + [PYENV]\testlink\Scripts\activate |
| 94 | + pip install TestLink-API-Python-client |
| 95 | + |
| 96 | +If you always work with the same TestLink server, extend the script |
| 97 | + |
| 98 | +- [PYENV]\testlink\Scripts\activate. |
| 99 | + |
| 100 | +with connection parameter as environment variables |
| 101 | + |
| 102 | +- TESTLINK_API_PYTHON_SERVER_URL and TESTLINK_API_PYTHON_DEVKEY |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +.. _PyPI: https://pypi.python.org/pypi |
| 107 | +.. _pip: http://www.pip-installer.org |
| 108 | +.. _SourceForge: http://sourceforge.net/projects/testlink-api-python-client/files/latest/download |
| 109 | +.. _GitHup Releases: https://github.com/lczub/TestLink-API-Python-client/releases |
| 110 | +.. _GitHup Master: https://github.com/lczub/TestLink-API-Python-client/archive/master.zip |
| 111 | +.. _virtualenv: http://www.virtualenv.org/en/latest/virtualenv.html |
0 commit comments