a file-based rest api client
Project description
athena
athena is a file-based rest api client.
$ pip install haondt-athena
$ athena init
$ cat << EOF > athena/hello.py
from athena.client import Athena
from athena.test import athert
def run(athena: Athena):
client = athena.client()
response = client.get('https://example.com')
athert(response.status_code).equals(200)
EOF
$ athena run athena/hello.py
hello: passed
athena provides a lightweight alternative to full-blown api platforms like Postman with a few key advantages:
- You are free to use any text editor you would like as the api client. Lightweight editors like Neovim or VSCode allow for a much thinner client.
- As the workbook is just a collection of plaintext files, you can keep it in the same git repo as the project it is testing.
- Since requests are just python modules, you can script to your hearts content, and leverage external python libraries.
Installation
athena can be installed as a pypi package or from source. athena requires python>=3.11.
# from pypi
python3 -m pip install haondt-athena
# from gitlab
python3 -m pip install haondt-athena --index-url https://gitlab.com/api/v4/projects/57154225/packages/pypi/simple
# from source
git clone https://gitlab.com/haondt/athena.git
python3 -m pip install ./athena
Usage
Quickstart guide and API / CLI reference available here: https://haondt.gitlab.io/docs/athena/
Development
Running Tests
how to run the e2e tests
- build docker images for the api echo server and for the test runner images
.tests/e2e/build_dockerfile.sh
- start both images to run the tests
./tests/e2e/run_tests.sh
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
haondt_athena-2.3.0.tar.gz
(35.9 kB
view hashes)
Built Distribution
Close
Hashes for haondt_athena-2.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c4c200a5f522ed1c3cfbc4991c045105d42237b17251272ec0437bb79a7ef6b |
|
MD5 | 7c15388a250e3f99e1cc910a56a5add2 |
|
BLAKE2b-256 | 82455a6d46bd461489365bedfcc0c469b5d3103b9217c79676e5b23e00bc692d |