Skip to main content

API testing framework for simplify assertion

Project description

Maritest

Build PyPI - Python Version PyPI - Status codecov

Maritest is an API testing framework that the purpose solely of simplifying assertion when doing testing in the API layer, it's an easy and convenient way to go iterative testing while keeping up the fast-paced development and being able to maintain all testing modules/scenarios without breaking change

Installation

To install maritest just simply using :

pip install maritest

Basic Usage

After you're done with installation, you can try to use this basic feature from Maritest for example

from maritest.assertion import Assert

request = Assert(
    method="GET",                   # required, support 5 common HTTP method
    url="https://api.services.com", # required
    headers={},                     # required, set as empty dict if not needed
    proxy={"http": "api.services"}, # not required, default set to None
    timeout=60,                     # not required, default set to 120 seconds
)

# choose several method what kind of assertion that you wanted
# 1. Assert that request is success
# 2. Assert that request is failed
request.assert_is_ok(message="Should be success")
request.assert_is_failed(message="Should be failed")

If the assertion for that request is successful and according to what we expected, then it will return with a custom message that you already set before based on the message argument. If not successful, then it will raise an AssertionError with a formatted error message that is already available (without you needing to customize the error message again).

For now, Maritest already have prepared several kinds of assertions method which include a common assertion that is always used in testing for API scenario. For further detail, please read the documentation

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

maritest-0.5.0.tar.gz (20.8 kB view hashes)

Uploaded Source

Built Distribution

maritest-0.5.0-py3-none-any.whl (25.0 kB view hashes)

Uploaded Python 3

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