A plugin which enable testing of target executables on Python3 unittest framework.
Project description
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.
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
Hashes for integration_test_plugin-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e401c49a0d750ff14e0bbcc704b93c1c17336316702212b9606eb444e449a5c8 |
|
MD5 | 78113b29cb121188fc5c38a810fe8caf |
|
BLAKE2b-256 | 0b2845843f307f160c8ad30642b482d38b677cb95483c13986a4e4f9ab4db054 |
Hashes for integration_test_plugin-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28fe306d83a1a4794cd694778d0581da862e324cd82e0cdbf4ad3a74a484ee95 |
|
MD5 | b6bb9efb68f068c5ed43d17d3bf260f7 |
|
BLAKE2b-256 | 752b3fdfabe73460ff32c62534354d9232dffea776e1a7fd6cfb65a86a05e3f8 |