Integration Test Plugin
A plugin which enable testing of target executables on Python3 unittest framework.
Intended user
- The person who wants to test executable with automated method. And the executable outputs stream.
Introduction
Integration Test Plugin is a Python package which adds testing functionality for executable to Python unittest. It supports automation because it is designed to be used with Python unittest together. And it works on various platforms.
User can define their own test case on python3 code using this package.
The Integration Test Plugin verifies behavior of process under test through stream such as stdout, stderr, log file. These verifies have timeout. When tested process crashes, the crash is detected as timeout.
Features
- Verification
- Tests can check expected patterns are in stream output.
- Tests can check exit of process and exit code.
- Tests can check presence of file, directory.
- Crash detection
- Tests can detect and make the result NG if the process under test crashes.
- Automation support
- All test cases can be discovered and run by command-line operation.
Motivation
With stream, we can test behavior of whole executable easily.
launch_testing is known as one of testing tool using stream.
It has useful assertions such as assertWaitFor verifies that expected string is in stream.
But, it is not available on out of ROS because it depends on ROS environment.
Therefore, this project aims to create a generic integration test tool that does not depend on specific platform.
Prerequisites
Supported Platform
- Linux
- Windows
- MacOS
Required Software
- Python 3 3.6.8 or above
How to Use
Install
pip install integration_test_plugin
Example
There are 2 examples.
Run
python -m unittest example.test_air_conditioner_simulation
python -m unittest example.test_mailer
Code
Verifier
Following verifiers are available on this project. Details are on implementation comment.
| Verifier | Package |
|---|---|
| ProcessVerifier.assertExit() | integration_test_plugin.process_verifier |
| StreamVerifier.assertPattern() | integration_test_plugin.stream_verifier |
| assertFileExist() assertFileNotExist() assertDirectoryExist() assertDirectoryNotExist() |
integration_test_plugin.path_verifier |
License
Copyright 2024 Hidekazu TAKAHASHI. This project is free and open-source software licensed under the MIT License.
Release files for integration-test-plugin 1.0.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 | |
|---|---|---|---|
| integration_test_plugin-1.0.0.tar.gz | 5.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| integration_test_plugin-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / integration_test_plugin-1.0.0.tar.gz
| Download URL | integration_test_plugin-1.0.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e401c49a0d750ff14e0bbcc704b93c1c17336316702212b9606eb444e449a5c8
|
|
BLAKE2b-256 checksum How to use checksums |
0b2845843f307f160c8ad30642b482d38b677cb95483c13986a4e4f9ab4db054
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8
|
Release files / integration_test_plugin-1.0.0-py3-none-any.whl
| Download URL | integration_test_plugin-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28fe306d83a1a4794cd694778d0581da862e324cd82e0cdbf4ad3a74a484ee95
|
|
BLAKE2b-256 checksum How to use checksums |
752b3fdfabe73460ff32c62534354d9232dffea776e1a7fd6cfb65a86a05e3f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8
|