opentmi-client
Project description
Python Client library for OpenTMI
This is the Python client library for OpenTMI.
installation
To install, simply use pip
:
$ pip install --upgrade opentmi-client
See the Developers Guide if you want to develop this library.
Command Line Interface
Library provides Command line Interface to communicate with OpenTMI -backend
$ opentmi --help
usage: opentmi [-h] [-v] [-s] [--host HOST] [--user USER]
[--password PASSWORD] [--token TOKEN]
[--token_service TOKEN_SERVICE] [-p PORT]
<subcommand> ...
optional arguments:
-h, --help show this help message and exit
-v verbose level... repeat up to three times.
-s, --silent Silent - only errors will be printed
--host HOST OpenTMI host, default: localhost
--user USER username
--password PASSWORD password
--token TOKEN Authentication token
--token_service TOKEN_SERVICE
Optional authentication service
-p PORT, --port PORT OpenTMI port
subcommand:
<subcommand> sub-command help
version Display version information
list List something
store Create something
example:
opentmi --host localhost --port 3000 --list --testcases 1
Python API
from opentmi_client import OpenTmiClient, Result
client = Client("https://127.0.0.1")
client.login_with_access_token("my-github-access-token")
result = Result()
result.tcid = "test-case-a"
result.verdict = "pass"
client.post_result(result)
See more examples from here.
Server side Result schema can be found from here. and Test case schema is available here.
notes
tcid
-field have to be unique for each test cases.- There is couple mandatory fields by default:
tcid
andexec.verdict
. Allowed values for result verdict is:pass
,fail
,inconclusive
,blocked
anderror
.upload_results()
-function also create test case document if it doesn't exists in database.
Authentication
There are multiple options to authenticate:
- use
Client.login(<username>, <password>)
- use
Client.login_with_access_token(<token>, [<service>])
- service are optional and supported values depend on server support.
By default
github
is in use.
- service are optional and supported values depend on server support.
By default
- Use environment variables (tries login automatically when constructor is called):
- Using username and password:
OPENTMI_USERNAME
andOPENTMI_PASSWORD
or - Using github access token:
OPENTMI_GITHUB_ACCESS_TOKEN
- Using username and password:
- use token in host like
http://<token>@localhost
LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
opentmi_client-0.4.1.tar.gz
(26.3 kB
view hashes)
Built Distribution
Close
Hashes for opentmi_client-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90896b754f7828c0a8ae3046e8a8210fde2f7b116d920bf7af9828b80c7bff1f |
|
MD5 | df76bb8b6cfdbc196df2cba0dbcb935c |
|
BLAKE2b-256 | 04bf7d3c5d187f9d3b9be8c2a7eeea0760326fa9f2e990c7fb2cb5bd73425b8f |