Add custom error types (#290)

* add error types

* better subclassing

* add response models

* fix comments

* add response_description to mint endpoints
This commit is contained in:
callebtc
2023-07-25 23:26:50 +02:00
committed by GitHub
parent b196c34427
commit 3d676dd35f
9 changed files with 294 additions and 151 deletions

View File

@@ -49,13 +49,13 @@ async def test_api_keyset_keys(ledger):
@pytest.mark.asyncio
async def test_api_mint_validation(ledger):
response = requests.get(f"{BASE_URL}/mint?amount=-21")
assert "error" in response.json()
assert "detail" in response.json()
response = requests.get(f"{BASE_URL}/mint?amount=0")
assert "error" in response.json()
assert "detail" in response.json()
response = requests.get(f"{BASE_URL}/mint?amount=2100000000000001")
assert "error" in response.json()
assert "detail" in response.json()
response = requests.get(f"{BASE_URL}/mint?amount=1")
assert "error" not in response.json()
assert "detail" not in response.json()
@pytest.mark.asyncio