From 95a22831aa0d726f7051202cd17f2cfb3012a9c7 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Thu, 16 Aug 2018 01:11:03 -0400 Subject: [PATCH] unit test fixes --- tests/unit/test_account.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/unit/test_account.py b/tests/unit/test_account.py index 61d62a35e..cbd3bc271 100644 --- a/tests/unit/test_account.py +++ b/tests/unit/test_account.py @@ -2,7 +2,7 @@ from binascii import hexlify from twisted.trial import unittest from twisted.internet import defer -from torba.coin.bitcoinsegwit import MainNetLedger +from torba.coin.bitcoinsegwit import MainNetLedger as ledger_class from torba.baseaccount import HierarchicalDeterministic, SingleKey from torba.wallet import Wallet @@ -11,8 +11,11 @@ class TestHierarchicalDeterministicAccount(unittest.TestCase): @defer.inlineCallbacks def setUp(self): - self.ledger = MainNetLedger({'db': MainNetLedger.database_class(':memory:')}) - yield self.ledger.db.start() + self.ledger = ledger_class({ + 'db': ledger_class.database_class(':memory:'), + 'headers': ledger_class.headers_class(':memory:'), + }) + yield self.ledger.db.open() self.account = self.ledger.account_class.generate(self.ledger, Wallet(), "torba") @defer.inlineCallbacks @@ -171,8 +174,11 @@ class TestSingleKeyAccount(unittest.TestCase): @defer.inlineCallbacks def setUp(self): - self.ledger = MainNetLedger({'db': MainNetLedger.database_class(':memory:')}) - yield self.ledger.db.start() + self.ledger = ledger_class({ + 'db': ledger_class.database_class(':memory:'), + 'headers': ledger_class.headers_class(':memory:'), + }) + yield self.ledger.db.open() self.account = self.ledger.account_class.generate( self.ledger, Wallet(), "torba", {'name': 'single-address'})