bleskomat WALLET class

This commit is contained in:
dni ⚡ 2022-12-07 13:55:29 +01:00
parent 4227fd70da
commit b470d40e38

View File

@ -9,10 +9,12 @@ from lnbits.extensions.bleskomat.helpers import (
generate_bleskomat_lnurl_signature,
query_to_signing_payload,
)
from lnbits.settings import settings
from lnbits.settings import settings, get_wallet_class
from tests.conftest import client
from tests.extensions.bleskomat.conftest import bleskomat, lnurl
from tests.helpers import credit_wallet, is_regtest, WALLET
from tests.helpers import credit_wallet, is_regtest
@pytest.mark.asyncio
@ -101,6 +103,7 @@ async def test_bleskomat_lnurl_api_action_insufficient_balance(client, lnurl):
bleskomat = lnurl["bleskomat"]
secret = lnurl["secret"]
pr = "lntb500n1pseq44upp5xqd38rgad72lnlh4gl339njlrsl3ykep82j6gj4g02dkule7k54qdqqcqzpgxqyz5vqsp5h0zgewuxdxcl2rnlumh6g520t4fr05rgudakpxm789xgjekha75s9qyyssq5vhwsy9knhfeqg0wn6hcnppwmum8fs3g3jxkgw45havgfl6evchjsz3s8e8kr6eyacz02szdhs7v5lg0m7wehd5rpf6yg8480cddjlqpae52xu"
WALLET = get_wallet_class()
WALLET.pay_invoice.reset_mock()
response = await client.get(f"/bleskomat/u?k1={secret}&pr={pr}")
assert response.status_code == 200
@ -127,6 +130,7 @@ async def test_bleskomat_lnurl_api_action_success(client, lnurl):
)
wallet = await get_wallet(bleskomat.wallet)
assert wallet.balance_msat == 100000
WALLET = get_wallet_class()
WALLET.pay_invoice.reset_mock()
response = await client.get(f"/bleskomat/u?k1={secret}&pr={pr}")
assert response.json() == {"status": "OK"}