From 0ffec82e3505c5bb170c73af69df64c18c24d67d Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Wed, 11 Jul 2018 22:47:44 -0400 Subject: [PATCH] unit test fixes --- tests/unit/test_account.py | 4 ++-- tests/unit/test_bip32.py | 4 ++-- tests/unit/test_transaction.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unit/test_account.py b/tests/unit/test_account.py index 7c492474f..4e26c68e5 100644 --- a/tests/unit/test_account.py +++ b/tests/unit/test_account.py @@ -8,7 +8,7 @@ from torba.coin.bitcoinsegwit import MainNetLedger class TestKeyChain(unittest.TestCase): def setUp(self): - self.ledger = MainNetLedger(db=MainNetLedger.database_class(':memory:')) + self.ledger = MainNetLedger({'db': MainNetLedger.database_class(':memory:')}) return self.ledger.db.start() @defer.inlineCallbacks @@ -68,7 +68,7 @@ class TestKeyChain(unittest.TestCase): class TestAccount(unittest.TestCase): def setUp(self): - self.ledger = MainNetLedger(db=MainNetLedger.database_class(':memory:')) + self.ledger = MainNetLedger({'db': MainNetLedger.database_class(':memory:')}) return self.ledger.db.start() @defer.inlineCallbacks diff --git a/tests/unit/test_bip32.py b/tests/unit/test_bip32.py index a10572bd7..90fcac263 100644 --- a/tests/unit/test_bip32.py +++ b/tests/unit/test_bip32.py @@ -40,7 +40,7 @@ class BIP32Tests(unittest.TestCase): with self.assertRaisesRegex(ValueError, 'private key must be 32 bytes'): PrivateKey(None, b'abcd', b'abcd'*8, 0, 255) private_key = PrivateKey( - MainNetLedger(db=True), + MainNetLedger({'db': True}), unhexlify('2423f3dc6087d9683f73a684935abc0ccd8bc26370588f56653128c6a6f0bf7c'), b'abcd'*8, 0, 1 ) @@ -57,7 +57,7 @@ class BIP32Tests(unittest.TestCase): self.assertIsInstance(private_key.child(PrivateKey.HARDENED), PrivateKey) def test_from_extended_keys(self): - ledger = MainNetLedger(db=True) + ledger = MainNetLedger({'db': True}) self.assertIsInstance( from_extended_key_string( ledger, diff --git a/tests/unit/test_transaction.py b/tests/unit/test_transaction.py index 56b25caa0..65b4334e8 100644 --- a/tests/unit/test_transaction.py +++ b/tests/unit/test_transaction.py @@ -30,7 +30,7 @@ def get_transaction(txo=None): class TestSizeAndFeeEstimation(unittest.TestCase): def setUp(self): - self.ledger = ledger_class(db=ledger_class.database_class(':memory:')) + self.ledger = ledger_class({'db': ledger_class.database_class(':memory:')}) return self.ledger.db.start() def io_fee(self, io): @@ -143,7 +143,7 @@ class TestTransactionSerialization(unittest.TestCase): class TestTransactionSigning(unittest.TestCase): def setUp(self): - self.ledger = ledger_class(db=ledger_class.database_class(':memory:')) + self.ledger = ledger_class({'db': ledger_class.database_class(':memory:')}) return self.ledger.db.start() @defer.inlineCallbacks