mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-13 12:33:25 +02:00
Add test for send payment with failure (#1586)
This commit is contained in:
parent
dd927036a5
commit
c7fa4ec47c
1 changed files with 17 additions and 0 deletions
|
|
@ -226,11 +226,21 @@ def lightning_client(info, invoice, pay_req, successful_payment):
|
|||
return MockLightningClient(info, invoice, pay_req, successful_payment)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def lightning_client_with_failed_payment(info, invoice, pay_req, failed_payment):
|
||||
return MockLightningClient(info, invoice, pay_req, failed_payment)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def squeak_core(bitcoin_client, lightning_client):
|
||||
yield SqueakCore(bitcoin_client, lightning_client)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def squeak_core_with_failed_payment(bitcoin_client, lightning_client_with_failed_payment):
|
||||
yield SqueakCore(bitcoin_client, lightning_client_with_failed_payment)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def peer_address():
|
||||
yield PeerAddress(
|
||||
|
|
@ -396,6 +406,13 @@ def test_sent_payment(sent_payment):
|
|||
assert sent_payment is not None
|
||||
|
||||
|
||||
def test_send_payment_with_failure(squeak_core_with_failed_payment, unpacked_offer):
|
||||
|
||||
with pytest.raises(Exception) as excinfo:
|
||||
squeak_core_with_failed_payment.pay_offer(unpacked_offer)
|
||||
assert "Payment failed with error" in str(excinfo.value)
|
||||
|
||||
|
||||
def test_unlock_squeak(squeak_core, squeak, squeak_content, sent_payment):
|
||||
decrypted_content = squeak_core.get_decrypted_content(
|
||||
squeak,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue