From e439fc0a2987ffed3c757a4e91ede2a9d752c955 Mon Sep 17 00:00:00 2001 From: Denis Angell Date: Fri, 2 Feb 2024 02:44:23 +0100 Subject: [PATCH] update tests --- examples/standalone.py | 4 +--- hooks_toolkit/asyncio_xrpld.py | 1 - hooks_toolkit/xrpld.py | 1 - poetry.lock | 6 +++--- tests/integration/hooks/toolbox/test_base.py | 2 +- tests/integration/hooks/toolbox/test_hook_on_tt.py | 2 +- tests/integration/hooks/toolbox/test_param_basic.py | 2 +- ...ecution_utility.py => test_async_execution_utility.py} | 6 +++--- ...{test_state_utility.py => test_async_state_utility.py} | 8 ++++---- 9 files changed, 14 insertions(+), 18 deletions(-) rename tests/integration/libs/asyncio/keylet_utils/{test_execution_utility.py => test_async_execution_utility.py} (97%) rename tests/integration/libs/asyncio/keylet_utils/{test_state_utility.py => test_async_state_utility.py} (97%) diff --git a/examples/standalone.py b/examples/standalone.py index 0eb7ad5..81928aa 100644 --- a/examples/standalone.py +++ b/examples/standalone.py @@ -39,9 +39,7 @@ def main(): result = Xrpld.submit(context.client, SmartContractParams(alice_wallet, built_tx)) - hook_executions = ExecutionUtility.get_hook_executions_from_meta( - context.client, result["meta"] - ) + hook_executions = ExecutionUtility.get_hook_executions_from_meta(result["meta"]) print(hook_executions.executions[0].HookReturnString) diff --git a/hooks_toolkit/asyncio_xrpld.py b/hooks_toolkit/asyncio_xrpld.py index 9ddf8e2..b8b3f35 100644 --- a/hooks_toolkit/asyncio_xrpld.py +++ b/hooks_toolkit/asyncio_xrpld.py @@ -25,7 +25,6 @@ async def submit(client: Client, params: SmartContractParams) -> Any: tx_result = tx_response.result.get("meta")["TransactionResult"] if tx_result == "tecHOOK_REJECTED": hook_executions = ExecutionUtility.get_hook_executions_from_meta( - client, tx_response.result.get("meta"), ) raise ValueError(hook_executions.executions[0].HookReturnString) diff --git a/hooks_toolkit/xrpld.py b/hooks_toolkit/xrpld.py index f462b34..20687d3 100644 --- a/hooks_toolkit/xrpld.py +++ b/hooks_toolkit/xrpld.py @@ -24,7 +24,6 @@ def submit(client: Client, params: SmartContractParams) -> Any: tx_result = tx_response.result.get("meta")["TransactionResult"] if tx_result == "tecHOOK_REJECTED": hook_executions = ExecutionUtility.get_hook_executions_from_meta( - client, tx_response.result.get("meta"), ) raise ValueError(hook_executions.executions[0].HookReturnString) diff --git a/poetry.lock b/poetry.lock index 27b9c02..233d8e0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -370,13 +370,13 @@ files = [ [[package]] name = "transia-xrpl-py" -version = "1.7.0a6" +version = "1.7.0a7" description = "A complete Python library for interacting with the XRP ledger" optional = false python-versions = ">=3.7,<4.0" files = [ - {file = "transia_xrpl_py-1.7.0a6-py3-none-any.whl", hash = "sha256:17209b360b320fded3b2b26d28a7e303294479c333ff487c87505ce89169969e"}, - {file = "transia_xrpl_py-1.7.0a6.tar.gz", hash = "sha256:a8bc566f6c2c1e3c2a8947a672c5313542d51f412e5931cd6941cd1f6fb0c151"}, + {file = "transia_xrpl_py-1.7.0a7-py3-none-any.whl", hash = "sha256:87576b8730078f7b94bddf32a90b0719ca8807171f775113fbfc1cd1aebb469f"}, + {file = "transia_xrpl_py-1.7.0a7.tar.gz", hash = "sha256:5e37e8a273a46e70ded671f11cb37a09ed703955012fbc68e040090a1e8bb6b2"}, ] [package.dependencies] diff --git a/tests/integration/hooks/toolbox/test_base.py b/tests/integration/hooks/toolbox/test_base.py index 9da7523..c4a2c52 100644 --- a/tests/integration/hooks/toolbox/test_base.py +++ b/tests/integration/hooks/toolbox/test_base.py @@ -57,7 +57,7 @@ def test_base(cls): ) hook_executions = ExecutionUtility.get_hook_executions_from_meta( - cls.context.client, result["meta"] + result["meta"] ) cls.assertEqual( diff --git a/tests/integration/hooks/toolbox/test_hook_on_tt.py b/tests/integration/hooks/toolbox/test_hook_on_tt.py index e0f1374..01d2967 100644 --- a/tests/integration/hooks/toolbox/test_hook_on_tt.py +++ b/tests/integration/hooks/toolbox/test_hook_on_tt.py @@ -57,7 +57,7 @@ def test_hook_on_tt(cls): ) hook_executions = ExecutionUtility.get_hook_executions_from_meta( - cls.context.client, result["meta"] + result["meta"] ) cls.assertEqual( diff --git a/tests/integration/hooks/toolbox/test_param_basic.py b/tests/integration/hooks/toolbox/test_param_basic.py index b92a751..058e72c 100644 --- a/tests/integration/hooks/toolbox/test_param_basic.py +++ b/tests/integration/hooks/toolbox/test_param_basic.py @@ -73,7 +73,7 @@ def test_param_basic(cls): ) hook_executions = ExecutionUtility.get_hook_executions_from_meta( - cls.context.client, result["meta"] + result["meta"] ) cls.assertEqual( diff --git a/tests/integration/libs/asyncio/keylet_utils/test_execution_utility.py b/tests/integration/libs/asyncio/keylet_utils/test_async_execution_utility.py similarity index 97% rename from tests/integration/libs/asyncio/keylet_utils/test_execution_utility.py rename to tests/integration/libs/asyncio/keylet_utils/test_async_execution_utility.py index fd095f5..91eb31b 100644 --- a/tests/integration/libs/asyncio/keylet_utils/test_execution_utility.py +++ b/tests/integration/libs/asyncio/keylet_utils/test_async_execution_utility.py @@ -13,7 +13,7 @@ class TestExecutionUtility(AsyncioIntegrationTestCase): - async def test_executions_from_meta(cls): + async def async_test_executions_from_meta(cls): async with cls.context.client as _: hook = create_hook_payload( SetHookParams( @@ -60,7 +60,7 @@ async def test_executions_from_meta(cls): cls.context.client, cls.context.hook1.seed, [clear_hook] ) - async def test_executions_from_tx_hash(cls): + async def async_test_executions_from_tx_hash(cls): async with cls.context.client as _: hook = create_hook_payload( SetHookParams( @@ -107,7 +107,7 @@ async def test_executions_from_tx_hash(cls): cls.context.client, cls.context.hook1.seed, [clear_hook] ) - async def test_emissions_from_meta(cls): + async def async_test_emissions_from_meta(cls): async with cls.context.client as _: hook = create_hook_payload( SetHookParams( diff --git a/tests/integration/libs/asyncio/keylet_utils/test_state_utility.py b/tests/integration/libs/asyncio/keylet_utils/test_async_state_utility.py similarity index 97% rename from tests/integration/libs/asyncio/keylet_utils/test_state_utility.py rename to tests/integration/libs/asyncio/keylet_utils/test_async_state_utility.py index 0cd4f3b..ae8bcd6 100644 --- a/tests/integration/libs/asyncio/keylet_utils/test_state_utility.py +++ b/tests/integration/libs/asyncio/keylet_utils/test_async_state_utility.py @@ -15,7 +15,7 @@ class TestStateUtility(AsyncioIntegrationTestCase): - async def test_get_hook(cls): + async def async_test_get_hook(cls): async with cls.context.client as _: hook = create_hook_payload( SetHookParams( @@ -60,7 +60,7 @@ async def test_get_hook(cls): cls.context.client, cls.context.hook1.seed, [clear_hook] ) - async def test_get_hook_definition(cls): + async def async_test_get_hook_definition(cls): async with cls.context.client as _: hook = create_hook_payload( SetHookParams( @@ -105,7 +105,7 @@ async def test_get_hook_definition(cls): cls.context.client, cls.context.hook1.seed, [clear_hook] ) - async def test_hook_state_dir(cls): + async def async_test_hook_state_dir(cls): async with cls.context.client as _: hook = create_hook_payload( SetHookParams( @@ -150,7 +150,7 @@ async def test_hook_state_dir(cls): cls.context.client, cls.context.hook1.seed, [clear_hook] ) - async def test_hook_state(cls): + async def async_test_hook_state(cls): async with cls.context.client as _: hook = create_hook_payload( SetHookParams(