mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-15 11:04:20 +01:00
test_lightningd.py: Test delexpiredinvoice.
This commit is contained in:
committed by
Christian Decker
parent
3b0081aebb
commit
de853b4847
@@ -453,6 +453,7 @@ class LightningDTests(BaseLightningDTests):
|
||||
l2.rpc.invoice('any', 'inv1', 'description', 10)
|
||||
l2.rpc.invoice('any', 'inv2', 'description', 4)
|
||||
l2.rpc.invoice('any', 'inv3', 'description', 16)
|
||||
creation = int(time.time())
|
||||
# Check waitinvoice correctly waits
|
||||
w1 = self.executor.submit(l2.rpc.waitinvoice, 'inv1')
|
||||
w2 = self.executor.submit(l2.rpc.waitinvoice, 'inv2')
|
||||
@@ -471,6 +472,16 @@ class LightningDTests(BaseLightningDTests):
|
||||
time.sleep(8) # total 20
|
||||
self.assertRaises(ValueError, w3.result)
|
||||
|
||||
# Test delexpiredinvoice
|
||||
l2.rpc.delexpiredinvoice(maxexpirytime=creation + 8)
|
||||
# only inv2 should have been deleted
|
||||
assert len(l2.rpc.listinvoices()['invoices']) == 2
|
||||
assert len(l2.rpc.listinvoices('inv2')['invoices']) == 0
|
||||
# Test delexpiredinvoice all
|
||||
l2.rpc.delexpiredinvoice()
|
||||
# all invoices are expired and should be deleted
|
||||
assert len(l2.rpc.listinvoices()['invoices']) == 0
|
||||
|
||||
def test_connect(self):
|
||||
l1, l2 = self.connect()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user