I've struggled and spent a lot of hours writing manual Python scripts to be able to test a product involving many microservices. All of them following the REST conventions. Overwhelmed with too many scripts, each one test different endpoints, how they respond also what they respond, I've decided to create a Python package to easily do this, without needing to create a manual Python script, import libraries to send an HTTP Request, copy and paste code from other scripts to test fast the new endpoints, etc.
Happy to announce pyhttptest!
My first contribution to the Python community, released in PyPI.
pyhttptest - A command-line tool for HTTP tests over Web server, elegantly solves the problem in simple three steps.
1. Install the package
pip install pyhttptest
2. Describe your HTTP Requests test cases against your service in a simplest and widely used format JSON within a file.
1. To send an HTTP GET Request:
Create a JSON file, for example, data/GET_USERS.json
{
"name": "TEST: Github Page",
"verb": "GET",
"endpoint": "/",
"host": "https://github.com",
"headers": {
"Accept-Language": "en-US"
}
}
2. To send an HTTP POST Request:
Create a JSON file, for example, data/POST_BIN.json
{
"name": "TEST: Create an HTML bin",
"verb": "POST",
"endpoint": "post",
"host": "https://httpbin.org",
"payload": {
"content": "Hello, world!"
}
}
The properties, which you can pass to a
.json
file are:NOTE: There are required and optional properties for .json
Required:
Optional:
3. Run command and gain report
pyhttptest execute data/GET_USERS.json
That's it!
Currently, the package is in the Beta version, it may contain bugs, not user-friendly messages, etc.
I want to gather feedback from anyone of you, it doesn't matter if it is positive or negative.
It'll help me to prepare the package to be better for the official release version.
Waiting for your feedback and list of features for implementation or features to remove to make your work easier!
Thanks for your attention and feedback! I've appreciated it!