TestRail Data Model
This package provides an object-oriented representation of TestRail data using Python data classes. This object structure facilitates the development of tools which programmatically interact with a TestRail service.
This wraps the tolstislon/testrail-api project, which in turn wraps the official TestRail API spec.
Example
from testrail_api import TestRailAPI
from testrail_data_model.builder import TestRailAPIObjectBuilder
from testrail_data_model.adapter import TestRailAPIAdapter
from testrail_data_model.model import TestRailSection, TestRailCase, TestRailSuite
# From testrail-api client library
api_client = TestRailAPI(url="https://testrail-instance.com", email="email@email.org", password="password")
# Performs API requests and tracks stats
adapter = TestRailAPIAdapter(api_client=api_client)
# For building the TestRail dataclass object hierarchies (e.g. TestRailSuite)
builder = TestRailAPIObjectBuilder(adapter=adapter)
# Construct a TestRailSuite object linked to its associated TestRailSection and TestRailCase objects
suite: TestRailSuite = builder.build_suite(project_id=1, suite_id=1)
# Display the TestRailSuite object structure
for section_id, section in suite.sections.items():
assert isinstance(section, TestRailSection)
print("Section", section_id, section.path)
for case_id, case in section.cases.items():
assert isinstance(case, TestRailCase)
print("Case", case_id, case.title)
# Show the number of API requests made
print(adapter.stats)
Authors
Metadata
Release files for testrail-data-model 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| testrail-data-model-0.2.0.tar.gz | 17.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| testrail_data_model-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.2 kB
Release files / testrail-data-model-0.2.0.tar.gz
| Download URL | testrail-data-model-0.2.0.tar.gz |
|---|---|
| Size | 17.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59801cf5fbe4526a94e8950f2cb0652755535371ef9091a1578c3ecf345ca977
|
|
BLAKE2b-256 checksum How to use checksums |
af3a552ef1dc8553926d864bcfbfe342e2f124474ddb35f63f6b9c390d86f68a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Release files / testrail_data_model-0.2.0-py3-none-any.whl
| Download URL | testrail_data_model-0.2.0-py3-none-any.whl |
|---|---|
| Size | 20.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5b30d29eddb4485cbbaad157bf3d46150a73a0d46b7a14478d715ed8c82fafe
|
|
BLAKE2b-256 checksum How to use checksums |
dee39c3f183ec22df711acc3d105ca8c5c9715050f514674fb8d5f77c3489370
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|