This package contains pytest fixtures that are used to test AWS Deadline Cloud Python packages.
Project description
AWS Deadline Cloud Test Fixtures
This package contains pytest fixtures that are used to test AWS Deadline Cloud Python packages.
Usage
To use this package:
- Install it into your test environment
- Configure environment variables needed for your tests (see src/deadline_test_fixtures/example_config.sh for available options)
- Use the fixtures in your tests (see src/deadline_test_fixtures/fixtures.py for available fixtures)
For example, to use the worker
fixture:
from deadline_test_fixtures import DeadlineWorker
def test_something_with_the_worker(worker: DeadlineWorker) -> None:
# GIVEN
worker.start()
# WHEN
result = worker.send_command("some command")
# THEN
assert result.stdout == "expected output"
You can also import the classes from this package directly to build your own fixtures
# double_worker.py
from deadline_test_fixtures import (
DeadlineWorker,
EC2InstanceWorker,
DockerContainerWorker,
)
class DoubleWorker(DeadlineWorker):
def __init__(
self,
# args...
) -> None:
self.ec2_worker = EC2InstanceWorker(
# args...
)
self.docker_worker = DockerContainerWorker(
# args...
)
def start(self) -> None:
self.ec2_worker.start()
self.docker_worker.start()
# etc.
# test_something.py
from .double_worker import DoubleWorker
import pytest
@pytest.fixture
def double_worker() -> DoubleWorker:
return DoubleWorker(
# args...
)
def test_something(double_worker: DoubleWorker) -> None:
# GIVEN
double_worker.start()
# etc.
Telemetry
This library collects telemetry data by default. Telemetry events contain non-personally-identifiable information that helps us understand how users interact with our software so we know what features our customers use, and/or what existing pain points are.
You can opt out of telemetry data collection by either:
- Setting the environment variable:
DEADLINE_CLOUD_TELEMETRY_OPT_OUT=true
- Setting the config file:
deadline config set telemetry.opt_out true
Note that setting the environment variable supersedes the config file setting.
Build / Test / Release
Build the package.
hatch build
Run tests
hatch run test
Run linting
hatch run lint
Run formating
hatch run fmt
Run a tests for all supported Python versions.
hatch run all:test
Compatibility
This library requires:
- Python 3.9 or higher; and
- Linux, MacOS, or Windows operating system.
Versioning
This package's version follows Semantic Versioning 2.0, but is still considered to be in its initial development, thus backwards incompatible versions are denoted by minor version bumps. To help illustrate how versions will increment during this initial development stage, they are described below:
- The MAJOR version is currently 0, indicating initial development.
- The MINOR version is currently incremented when backwards incompatible changes are introduced to the public API.
- The PATCH version is currently incremented when bug fixes or backwards compatible changes are introduced to the public API.
Downloading
You can download this package from:
Security
See CONTRIBUTING for more information.
License
This project is licensed under the Apache-2.0 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
Built Distribution
File details
Details for the file deadline_cloud_test_fixtures-0.12.0.tar.gz
.
File metadata
- Download URL: deadline_cloud_test_fixtures-0.12.0.tar.gz
- Upload date:
- Size: 41.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d012b33d3b40d43a69e446d61732c1559a8814d64dfe752c10d7ed765e356b9 |
|
MD5 | b319ef130d6afd18ee8fb91cfeb528f2 |
|
BLAKE2b-256 | 780bb6f98017583c6ccdb942c85be09f5bb833ae2449933d0230bf117f992ca0 |
File details
Details for the file deadline_cloud_test_fixtures-0.12.0-py3-none-any.whl
.
File metadata
- Download URL: deadline_cloud_test_fixtures-0.12.0-py3-none-any.whl
- Upload date:
- Size: 48.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53d3c73af8cbe2e08b78943aa47ad268ff28e3cac6429167ce64e6ad7015d103 |
|
MD5 | bb1ca7fee21c776dbd8ef79e2ecb20bb |
|
BLAKE2b-256 | f0ad9ce459b7faf273c1d450c77350e86e3c5e7c5c5b4419e3f52e44886b8b55 |