Skip to content

Commit

Permalink
Add exclude providers unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryp Toon committed May 6, 2024
1 parent a2784a1 commit 3e49628
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bitcoinlib/wallets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2485,7 +2485,8 @@ def keys(self, account_id=None, name=None, key_id=None, change=None, depth=None,
keys2.append({k: v for (k, v) in key.items()
if k[:1] != '_' and k != 'wallet' and k not in private_fields})
return keys2
qr.session.close()
# qr.session.close()
qr.session.commit()
return keys

def keys_networks(self, used=None, as_dict=False):
Expand Down
6 changes: 6 additions & 0 deletions tests/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,12 @@ def test_service_transaction_unconfirmed(self):
self.assertIsNone(t.date)
self.assertIsNone(t.block_height)

def test_service_exlude_providers(self):
srv = ServiceTest(network='testnet', cache_uri='')
providers = [srv.providers[pi]['provider'] for pi in srv.providers]
srv2 = ServiceTest(network='testnet', exclude_providers=providers[1:], cache_uri='')
self.assertEqual(len(srv2.providers), 1)


class TestServiceCache(unittest.TestCase):

Expand Down

0 comments on commit 3e49628

Please sign in to comment.