CI: Test core/views/generic.py (#772)

* Adds tests for GET /wallet

* Update `httpx` to `0.23.0` and `http-core` to `0.15.0` in `venv` installation path

* Fix `secp256k1 = "==0.14.0"` and `cffi = "==1.15.0"`
This commit is contained in:
calle
2022-07-23 10:39:58 +02:00
committed by GitHub
parent fd0d6bffce
commit 96af5fc3a7
10 changed files with 258 additions and 156 deletions
+18 -3
View File
@@ -11,11 +11,26 @@ async def test_core_views_generic(client):
assert response.status_code == 200
# check GET /api/v1/wallet: wallet info
# check GET /api/v1/wallet with inkey: wallet info, no balance
@pytest.mark.asyncio
async def test_get_wallet(client, inkey_headers_to):
async def test_get_wallet_inkey(client, inkey_headers_to):
response = await client.get("/api/v1/wallet", headers=inkey_headers_to)
assert response.status_code < 300
assert response.status_code == 200
result = response.json()
assert "name" in result
assert "balance" in result
assert "id" not in result
# check GET /api/v1/wallet with adminkey: wallet info with balance
@pytest.mark.asyncio
async def test_get_wallet_adminkey(client, adminkey_headers_to):
response = await client.get("/api/v1/wallet", headers=adminkey_headers_to)
assert response.status_code == 200
result = response.json()
assert "name" in result
assert "balance" in result
assert "id" in result
# check POST /api/v1/payments: invoice creation