Skip to main content

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.

Concept

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


Download files

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

Source Distribution

integration_test_plugin-1.0.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

integration_test_plugin-1.0.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file integration_test_plugin-1.0.0.tar.gz.

File metadata

  • Download URL: integration_test_plugin-1.0.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for integration_test_plugin-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e401c49a0d750ff14e0bbcc704b93c1c17336316702212b9606eb444e449a5c8
MD5 78113b29cb121188fc5c38a810fe8caf
BLAKE2b-256 0b2845843f307f160c8ad30642b482d38b677cb95483c13986a4e4f9ab4db054

See more details on using hashes here.

File details

Details for the file integration_test_plugin-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: integration_test_plugin-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for integration_test_plugin-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28fe306d83a1a4794cd694778d0581da862e324cd82e0cdbf4ad3a74a484ee95
MD5 b6bb9efb68f068c5ed43d17d3bf260f7
BLAKE2b-256 752b3fdfabe73460ff32c62534354d9232dffea776e1a7fd6cfb65a86a05e3f8

See more details on using hashes here.

Supported by

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