Package for creating and managing objects from the TestRail API
Project description
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file testrail-data-model-0.2.0.tar.gz.
File metadata
- Download URL: testrail-data-model-0.2.0.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59801cf5fbe4526a94e8950f2cb0652755535371ef9091a1578c3ecf345ca977
|
|
| MD5 |
6606b4c66aff53979078bbf117630585
|
|
| BLAKE2b-256 |
af3a552ef1dc8553926d864bcfbfe342e2f124474ddb35f63f6b9c390d86f68a
|
File details
Details for the file testrail_data_model-0.2.0-py3-none-any.whl.
File metadata
- Download URL: testrail_data_model-0.2.0-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5b30d29eddb4485cbbaad157bf3d46150a73a0d46b7a14478d715ed8c82fafe
|
|
| MD5 |
bd9c3f64d634eb50433b668655d363b2
|
|
| BLAKE2b-256 |
dee39c3f183ec22df711acc3d105ca8c5c9715050f514674fb8d5f77c3489370
|