From 83c0baa3cb28a323e200962941484287a0d32eb4 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Tue, 6 Nov 2018 19:16:55 -0500 Subject: [PATCH] test abandoning claim at a loss, required a fix in torba --- tests/integration/wallet/test_commands.py | 32 ++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/integration/wallet/test_commands.py b/tests/integration/wallet/test_commands.py index 7b8557bf6..e7e85b29c 100644 --- a/tests/integration/wallet/test_commands.py +++ b/tests/integration/wallet/test_commands.py @@ -606,10 +606,40 @@ class PublishCommand(CommandTestCase): )) -class SupportingSupports(CommandTestCase): +class AbandonCommand(CommandTestCase): VERBOSITY = logging.INFO + async def test_abandoning_claim_at_loss(self): + + self.assertEqual('10.0', await self.daemon.jsonrpc_account_balance()) + + # create the initial name claim + with tempfile.NamedTemporaryFile() as file: + file.write(b'hi!') + file.flush() + claim = await self.out(self.daemon.jsonrpc_publish( + 'hovercraft', '0.0001', file_path=file.name + )) + self.assertTrue(claim['success']) + + await self.on_transaction_dict(claim['tx']) + await self.generate(1) + + self.assertEqual('9.979793', await self.daemon.jsonrpc_account_balance()) + + abandon = await self.out(self.daemon.jsonrpc_claim_abandon(claim['claim_id'])) + + await self.on_transaction_dict(abandon['tx']) + await self.generate(1) + + self.assertEqual('9.97968399', await self.daemon.jsonrpc_account_balance()) + + +class SupportingSupports(CommandTestCase): + + VERBOSITY = logging.WARN + async def test_regular_supports_and_tip_supports(self): # account2 will be used to send tips and supports to account1 account2_id = (await self.daemon.jsonrpc_account_create('second account'))['id']