No project description provided
Project description
jj-district42
Installation
pip3 install jj-district42
Usage
import asyncio
import jj
from httpx import AsyncClient
from jj.mock import mocked
from jj_district42 import HistorySchema
from valera import validate_or_fail
async def main():
matcher = jj.match("GET", "/users")
response = jj.Response(status=200, json=[])
async with mocked(matcher, response) as mock:
async with AsyncClient() as client:
await client.get("http://localhost:8080/users")
assert validate_or_fail(
HistorySchema % [
{
"request": {
"method": "GET",
"path": "/users"
},
"response": {
"status": 200
}
}
],
mock.history
)
asyncio.run(main())
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
jj-district42-0.1.0.tar.gz
(12.5 kB
view hashes)
Built Distribution
Close
Hashes for jj_district42-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1112fcb02be6fb0b45d3d437400e50f4fdbe06a4c5fb4ddbc0293127322ea55b |
|
MD5 | a211712e463ee8fcdc43bf06390b2987 |
|
BLAKE2b-256 | 425ceca27bf9d11d1a859166893910289fda2df8429cc327427f0745d031254b |