Add test on mempool vs tx_id

This commit is contained in:
Michał Sałaban 2020-06-09 14:05:02 +02:00
parent 74704a9b37
commit 36af7fd8ee
1 changed files with 17 additions and 0 deletions

View File

@ -282,5 +282,22 @@ class FiltersTestCase(unittest.TestCase):
'd29264ad317e8fdb55ea04484c00420430c35be7b3fe6dd663f99aebf41a786c')
self.assertEqual(len(w), 0)
def test_filter_mempool_filter_txid(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
# mempool excluded
pmts = self.wallet.incoming(
tx_id='d29264ad317e8fdb55ea04484c00420430c35be7b3fe6dd663f99aebf41a786c')
self.assertEqual(len(pmts), 0)
# mempool included
pmts = self.wallet.incoming(
unconfirmed=True,
tx_id='d29264ad317e8fdb55ea04484c00420430c35be7b3fe6dd663f99aebf41a786c')
self.assertEqual(len(pmts), 1)
self.assertEqual(
pmts[0].transaction.hash,
'd29264ad317e8fdb55ea04484c00420430c35be7b3fe6dd663f99aebf41a786c')
self.assertEqual(len(w), 0)
def test_filter_excessive(self):
self.assertRaises(ValueError, self.wallet.incoming, excessive_argument='foo')