Skip to main content

Package for creating and managing objects from the TestRail API

Project description

TestRail Data Model

Python package PyPI Downloads PyPI - Python Version PyPI - Implementation License Coverage Status

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

testrail-data-model-0.2.0.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

testrail_data_model-0.2.0-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

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

Hashes for testrail-data-model-0.2.0.tar.gz
Algorithm Hash digest
SHA256 59801cf5fbe4526a94e8950f2cb0652755535371ef9091a1578c3ecf345ca977
MD5 6606b4c66aff53979078bbf117630585
BLAKE2b-256 af3a552ef1dc8553926d864bcfbfe342e2f124474ddb35f63f6b9c390d86f68a

See more details on using hashes here.

File details

Details for the file testrail_data_model-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for testrail_data_model-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5b30d29eddb4485cbbaad157bf3d46150a73a0d46b7a14478d715ed8c82fafe
MD5 bd9c3f64d634eb50433b668655d363b2
BLAKE2b-256 dee39c3f183ec22df711acc3d105ca8c5c9715050f514674fb8d5f77c3489370

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page