From cf3efcea0dbe68f265d2ad0bd18c0366cdbbb148 Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Sun, 2 May 2021 16:20:26 +0200 Subject: [PATCH] [mod] #396: Remove async kw from tests/patched --- tests/patched/blockchain_tools.py | 6 +++--- tests/patched/money.py | 4 ++-- tests/patched/tools.py | 2 +- tests/patched/tx.py | 6 +++--- tests/patched/tx_history.py | 2 +- tests/patched/wot.py | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/patched/blockchain_tools.py b/tests/patched/blockchain_tools.py index 9d2ac60e..2f6e6eab 100644 --- a/tests/patched/blockchain_tools.py +++ b/tests/patched/blockchain_tools.py @@ -32,17 +32,17 @@ fake_block_uid = BlockUID( ) -async def patched_params(self): +def patched_params(self): return { "msValidity": 31557600, "msPeriod": 5259600, } -async def patched_block(self, number): +def patched_block(self, number): return mocked_block ## mock head_block() -async def patched_head_block(self): +def patched_head_block(self): return mocked_block diff --git a/tests/patched/money.py b/tests/patched/money.py index 04507123..ccf0488b 100644 --- a/tests/patched/money.py +++ b/tests/patched/money.py @@ -40,12 +40,12 @@ from silkaj.money import amount_in_current_base from silkaj.tx import MAX_INPUTS_PER_TX -async def patched_ud_value(self): +def patched_ud_value(self): return mock_ud_value # mock get_sources() -async def patched_get_sources(pubkey): +def patched_get_sources(pubkey): """ Returns transaction sources. This function doesn't cover all possibilities : only SIG() unlock condition. diff --git a/tests/patched/tools.py b/tests/patched/tools.py index 8f8ec081..75614834 100644 --- a/tests/patched/tools.py +++ b/tests/patched/tools.py @@ -17,5 +17,5 @@ from silkaj.constants import G1_SYMBOL # mock CurrencySymbol().symbol -async def patched_currency_symbol(self): +def patched_currency_symbol(self): return G1_SYMBOL diff --git a/tests/patched/tx.py b/tests/patched/tx.py index 3a17bd23..18160c16 100644 --- a/tests/patched/tx.py +++ b/tests/patched/tx.py @@ -18,7 +18,7 @@ from duniterpy.key import SigningKey from silkaj.tools import message_exit -async def patched_gen_confirmation_table( +def patched_gen_confirmation_table( issuer_pubkey, pubkey_amount, tx_amounts, @@ -43,7 +43,7 @@ async def patched_gen_confirmation_table( ) -async def patched_handle_intermediaries_transactions( +def patched_handle_intermediaries_transactions( key, issuers, tx_amounts, @@ -68,7 +68,7 @@ async def patched_handle_intermediaries_transactions( ) -async def patched_generate_and_send_transaction( +def patched_generate_and_send_transaction( key, issuers, tx_amounts, diff --git a/tests/patched/tx_history.py b/tests/patched/tx_history.py index c61ecfa7..b677b168 100644 --- a/tests/patched/tx_history.py +++ b/tests/patched/tx_history.py @@ -110,7 +110,7 @@ fake_sent_tx_hist = [ ] -async def patched_get_transactions_history(client, pubkey, received_txs, sent_txs): +def patched_get_transactions_history(client, pubkey, received_txs, sent_txs): for received in fake_received_tx_hist: received_txs.append(Transaction.from_bma_history(currency, received)) for sent in fake_sent_tx_hist: diff --git a/tests/patched/wot.py b/tests/patched/wot.py index 86924488..4bf3e37d 100644 --- a/tests/patched/wot.py +++ b/tests/patched/wot.py @@ -27,7 +27,7 @@ pubkey_list = [ # mock is_member -async def patched_is_member(pubkey): +def patched_is_member(pubkey): for account in pubkey_list: if account["pubkey"] == pubkey: if account["uid"]: @@ -36,7 +36,7 @@ async def patched_is_member(pubkey): # patch wot requirements -async def patched_wot_requirements_one_pending(pubkey, identity_uid): +def patched_wot_requirements_one_pending(pubkey, identity_uid): return { "identities": [ { @@ -59,7 +59,7 @@ async def patched_wot_requirements_one_pending(pubkey, identity_uid): } -async def patched_wot_requirements_no_pending(pubkey, identity_uid): +def patched_wot_requirements_no_pending(pubkey, identity_uid): return { "identities": [ { @@ -73,7 +73,7 @@ async def patched_wot_requirements_no_pending(pubkey, identity_uid): # for history -async def patched_identities_from_pubkeys(pubkeys, uids): +def patched_identities_from_pubkeys(pubkeys, uids): if not uids: return list() uniq_pubkeys = list(filter(None, set(pubkeys))) -- GitLab