From fc0c8fc16c4328cb3b24f79309cffe7645685172 Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Sat, 13 Mar 2021 13:25:18 +0100 Subject: [PATCH] [mod] #172: Rename transaction_confirmation to gen_confirmation_table --- silkaj/tx.py | 4 ++-- tests/patched/tx.py | 2 +- tests/test_tx.py | 6 +++--- tests/test_unit_tx.py | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/silkaj/tx.py b/silkaj/tx.py index f2ce0273..2d91a931 100644 --- a/silkaj/tx.py +++ b/silkaj/tx.py @@ -139,7 +139,7 @@ async def send_transaction( if not yes: confirmation_table = tabulate( - await transaction_confirmation( + await gen_confirmation_table( issuer_pubkey, pubkey_amount[0], tx_amounts, @@ -231,7 +231,7 @@ def check_transaction_values( return outputBackChange -async def transaction_confirmation( +async def gen_confirmation_table( issuer_pubkey, pubkey_amount, tx_amounts, diff --git a/tests/patched/tx.py b/tests/patched/tx.py index 51b73070..f8cd92f9 100644 --- a/tests/patched/tx.py +++ b/tests/patched/tx.py @@ -2,7 +2,7 @@ from duniterpy.key import SigningKey from silkaj.tools import message_exit -async def patched_transaction_confirmation( +async def patched_gen_confirmation_table( issuer_pubkey, pubkey_amount, tx_amounts, diff --git a/tests/test_tx.py b/tests/test_tx.py index d6caf2de..edaa2618 100644 --- a/tests/test_tx.py +++ b/tests/test_tx.py @@ -33,7 +33,7 @@ from silkaj.constants import ( from patched.money import patched_ud_value, patched_get_sources from patched.test_constants import mock_ud_value from patched.auth import patched_auth_method -from patched.tx import patched_transaction_confirmation +from patched.tx import patched_gen_confirmation_table # AsyncMock available from Python 3.8. asynctest is used for Py < 3.8 if sys.version_info[1] > 7: @@ -229,9 +229,9 @@ def test_tx_passed_all_sources_empty( # patch functions monkeypatch.setattr("silkaj.auth.auth_method", auth_method) monkeypatch.setattr("silkaj.money.get_sources", patched_get_sources) - patched_transaction_confirmation = AsyncMock() + patched_gen_confirmation_table = AsyncMock() monkeypatch.setattr( - "silkaj.tx.transaction_confirmation", patched_transaction_confirmation + "silkaj.tx.transaction_confirmation", patched_gen_confirmation_table ) result = CliRunner().invoke(cli, args=arguments) diff --git a/tests/test_unit_tx.py b/tests/test_unit_tx.py index 89278b6f..de3a37e3 100644 --- a/tests/test_unit_tx.py +++ b/tests/test_unit_tx.py @@ -45,7 +45,7 @@ from patched.tools import patched_currency_symbol from patched.blockchain_tools import patched_head_block, fake_block_uid from patched.auth import patched_auth_method from patched.tx import ( - patched_transaction_confirmation, + patched_gen_confirmation_table, patched_handle_intermediaries_transactions, ) @@ -118,7 +118,7 @@ def test_truncBase(amount, base, expected): ], ) @pytest.mark.asyncio -async def test_transaction_confirmation( +async def test_gen_confirmation_table( issuer_pubkey, pubkey_balance, tx_amounts, @@ -170,7 +170,7 @@ async def test_transaction_confirmation( expected.append(["Comment", comment]) # asserting - table_list = await tx.transaction_confirmation( + table_list = await tx.gen_confirmation_table( issuer_pubkey, pubkey_balance, tx_amounts, @@ -939,13 +939,13 @@ def test_send_transaction( return args_list # mocking functions - patched_transaction_confirmation = AsyncMock(return_value=None) + patched_gen_confirmation_table = AsyncMock(return_value=None) patched_handle_intermediaries_transactions = AsyncMock(return_value=None) # patching functions monkeypatch.setattr("silkaj.auth.auth_method", patched_auth_method_tx) monkeypatch.setattr( - "silkaj.tx.transaction_confirmation", patched_transaction_confirmation + "silkaj.tx.gen_confirmation_table", patched_gen_confirmation_table ) monkeypatch.setattr( "silkaj.tx.handle_intermediaries_transactions", @@ -981,7 +981,7 @@ def test_send_transaction( print(result.output) if confirmation_answer: - patched_transaction_confirmation.assert_any_await( + patched_gen_confirmation_table.assert_any_await( key_fifi.pubkey, total_amount, tx_amounts, -- GitLab