fix windows complaints on permissions for wallet file test
This commit is contained in:
parent
83a1a4ea3e
commit
e65e49768a
1 changed files with 10 additions and 8 deletions
|
@ -189,16 +189,18 @@ class TestFileBasedWalletManager(AsyncioTestCase):
|
||||||
manager = WalletManager(self.db)
|
manager = WalletManager(self.db)
|
||||||
await manager.storage.prepare()
|
await manager.storage.prepare()
|
||||||
|
|
||||||
with tempfile.NamedTemporaryFile(suffix='.json') as wallet_file:
|
wallet_file_name = None
|
||||||
|
with tempfile.NamedTemporaryFile(suffix='.json', delete=False) as wallet_file:
|
||||||
wallet_file.write(b'{"version": 1}')
|
wallet_file.write(b'{"version": 1}')
|
||||||
wallet_file.seek(0)
|
wallet_file.seek(0)
|
||||||
|
wallet_file_name = wallet_file.name
|
||||||
|
|
||||||
# create and write wallet to a file
|
# create and write wallet to a file
|
||||||
wallet = await manager.load(wallet_file.name)
|
wallet = await manager.load(wallet_file_name)
|
||||||
account = await wallet.accounts.generate()
|
account = await wallet.accounts.generate()
|
||||||
await manager.storage.save(wallet)
|
await manager.storage.save(wallet)
|
||||||
|
|
||||||
# read wallet from file
|
# read wallet from file
|
||||||
wallet = await manager.load(wallet_file.name)
|
wallet = await manager.load(wallet_file_name)
|
||||||
|
|
||||||
self.assertEqual(account.public_key.address, wallet.accounts.default.public_key.address)
|
self.assertEqual(account.public_key.address, wallet.accounts.default.public_key.address)
|
||||||
|
|
Loading…
Add table
Reference in a new issue