Trickester is a Python/Flask application for mocking REST APIs
Project description
Trickster
Trickster is a Python/Flask application providing configurable API. It allows you to configure requests and responses using REST API.
Usecases
- Local development. Sometimes your app needs lots of other services to work properly. Setting all that infrastructure might me time consuming and sometimes not even possible. Mock Service allows you to mock all necessary upstream services.
- Integration testing. The same way you need to setup infrastructure to develop locally, it might equally difficult to setup integration environment. Some services are just too hard to configure so you can test all scenarios. By using Mock Service you define expected behaviour. If you later find a bug, it's easy to find if your assumptions about the infrastructure was wrong or if there's a bug somewhere else.
- Performance testing. When running performance tests, the upstream services might cause a bottleneck. The test then actually tests your infrastructure, not your application. Or you might want to test what your application will do when all the dependencies start responding slowly or raise errors.
- Distributing work. Distributing work on new project between teams is challenging when you don't have a working API. Mock Service allows you to specify and document the API beforehand so everyone can start developing as if they have everything they need.
Quickstart
Create new Route:
curl --location --request POST 'http://127.0.0.1:8080/internal/routes' --header 'Content-Type: application/json' --data-raw '{
"path": "/hello_world",
"responses": [
{
"body": "Hello Word!"
}
]
}'
You configured a new Route that lives on /hello_word
. When you call it, it will return HTTP 200 and string Hello Word
.
You can test it by calling:
curl --location --request GET 'http://127.0.0.1:8080/hello_word'
You can find more information about this example in the Cookbook.
Of course, Trickster provides way more possibilities to configure how the Routes will work. All features are described in Documentation.
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
File details
Details for the file trickster-2.0.2.tar.gz
.
File metadata
- Download URL: trickster-2.0.2.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eb04608d40594be2512032f35126e9f7a2387fa481598eec5356cdd613bb52f |
|
MD5 | 12505f0d60d9ce6999460ba4967cb86e |
|
BLAKE2b-256 | 7e39ea9e36a8cc510f0be78efc604e1d28f674cc007f8c903e994855c3c74ebf |
File details
Details for the file trickster-2.0.2-py3-none-any.whl
.
File metadata
- Download URL: trickster-2.0.2-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e32c0955d2ccbe72942a62792677849456c8ed830520e16e9d18c4021cdaba6 |
|
MD5 | c7aac3db89dc5531f9dbec2729743653 |
|
BLAKE2b-256 | b040b22ebba17b003539f318a08ac4c52f22018ebe23db7762b841bfe1b22c9f |