Skip to main content

Python Client library for OpenTMI

CircleCI Coverage Status

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 and exec.verdict. Allowed values for result verdict is: pass, fail, inconclusive, blocked and error. 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.
  • Use environment variables (tries login automatically when constructor is called):
    • Using username and password: OPENTMI_USERNAME and OPENTMI_PASSWORD or
    • Using github access token: OPENTMI_GITHUB_ACCESS_TOKEN
  • use token in host like http://<token>@localhost

LICENSE

MIT

Metadata

Release files for opentmi-client 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opentmi-client 0.4.0
File Size Uploaded
opentmi_client-0.4.0.tar.gz 26.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opentmi-client 0.4.0
File Interpreter ABI Platform
opentmi_client-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 58.2 kB

Release files / opentmi_client-0.4.0.tar.gz

Download URL opentmi_client-0.4.0.tar.gz
Size 26.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d0f4adc52994c5c217e61427fd7b2bb72714a03c056e06f384fb2c8c84da4c63
BLAKE2b-256 checksum
How to use checksums
f2c144237cb081c2b55396ef20a744f4e48d6f4b4ad56a5830ac15fbc8266956
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

Release files / opentmi_client-0.4.0-py3-none-any.whl

Download URL opentmi_client-0.4.0-py3-none-any.whl
Size 32.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b8d622e5e555d984caadca33041469e4b7978bef421099240e2433fcfb40d3b
BLAKE2b-256 checksum
How to use checksums
9bd50cee6be6135e93d91482df6359d14c23b57dd6f6b26af9205ff155ede46b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

Release history Release notifications | RSS feed

0.12.0

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

This release

0.4.0 This release

2 release files

0.3.3

2 release files

0.3.2

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page