forked from LBRYCommunity/lbry-sdk
improving code coverage
This commit is contained in:
parent
dd40d2e6ce
commit
e2296d4491
2 changed files with 2 additions and 9 deletions
|
@ -70,8 +70,7 @@ class TestWalletCreation(unittest.TestCase):
|
||||||
wallet_file.seek(0)
|
wallet_file.seek(0)
|
||||||
|
|
||||||
# create and write wallet to a file
|
# create and write wallet to a file
|
||||||
wallet_storage = WalletStorage(wallet_file.name)
|
wallet = manager.import_wallet(wallet_file.name)
|
||||||
wallet = Wallet.from_storage(wallet_storage, manager)
|
|
||||||
account = wallet.generate_account(ledger)
|
account = wallet.generate_account(ledger)
|
||||||
wallet.save()
|
wallet.save()
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ class WalletManager(object):
|
||||||
self.ledgers[ledger_class] = ledger
|
self.ledgers[ledger_class] = ledger
|
||||||
return ledger
|
return ledger
|
||||||
|
|
||||||
def create_wallet(self, path):
|
def import_wallet(self, path):
|
||||||
storage = WalletStorage(path)
|
storage = WalletStorage(path)
|
||||||
wallet = Wallet.from_storage(storage, self)
|
wallet = Wallet.from_storage(storage, self)
|
||||||
self.wallets.append(wallet)
|
self.wallets.append(wallet)
|
||||||
|
@ -57,12 +57,6 @@ class WalletManager(object):
|
||||||
for wallet in self.wallets:
|
for wallet in self.wallets:
|
||||||
return wallet.default_account
|
return wallet.default_account
|
||||||
|
|
||||||
def get_accounts(self, coin_class):
|
|
||||||
for wallet in self.wallets:
|
|
||||||
for account in wallet.accounts:
|
|
||||||
if account.coin.__class__ is coin_class:
|
|
||||||
yield account
|
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def start(self):
|
def start(self):
|
||||||
self.running = True
|
self.running = True
|
||||||
|
|
Loading…
Reference in a new issue