From 38d3aea273fdd0b708270899e4cf53dfa354ba70 Mon Sep 17 00:00:00 2001 From: Piper Merriam Date: Tue, 14 Feb 2017 21:49:42 -0700 Subject: [PATCH] more test cleanup --- tests/admin-module/test_admin_setSolc.py | 6 ++++-- tests/caching-utils/test_generate_cache_key.py | 7 ++++--- tests/contracts/test_contract_constructor_encoding.py | 8 +++++--- tests/contracts/test_contract_deployment.py | 4 +++- tests/contracts/test_contract_estimateGas.py | 2 +- tests/contracts/test_contract_transact_interface.py | 9 +++++---- tests/contracts/test_extracting_event_data.py | 11 +++++------ tests/eth-module/test_eth_accounts.py | 2 +- tests/eth-module/test_eth_blockNumber.py | 2 +- tests/eth-module/test_eth_getBlock.py | 2 +- 10 files changed, 30 insertions(+), 23 deletions(-) diff --git a/tests/admin-module/test_admin_setSolc.py b/tests/admin-module/test_admin_setSolc.py index 0a28087..2e65629 100644 --- a/tests/admin-module/test_admin_setSolc.py +++ b/tests/admin-module/test_admin_setSolc.py @@ -1,8 +1,10 @@ import pytest -from web3.utils.compat import subprocess +from eth_utils import ( + force_text, +) -from web3.utils.string import force_text +from web3.utils.compat import subprocess def test_admin_setSolc(web3, skip_if_testrpc): diff --git a/tests/caching-utils/test_generate_cache_key.py b/tests/caching-utils/test_generate_cache_key.py index 34edf71..c32f97d 100644 --- a/tests/caching-utils/test_generate_cache_key.py +++ b/tests/caching-utils/test_generate_cache_key.py @@ -6,15 +6,16 @@ from hypothesis import ( import random -from web3.utils.functional import ( - cast_return_to_dict, +from eth_utils import ( + to_dict, ) + from web3.utils.caching import ( generate_cache_key, ) -@cast_return_to_dict +@to_dict def shuffle_dict(_dict): keys = list(_dict.keys()) random.shuffle(keys) diff --git a/tests/contracts/test_contract_constructor_encoding.py b/tests/contracts/test_contract_constructor_encoding.py index 93a9944..f0ab874 100644 --- a/tests/contracts/test_contract_constructor_encoding.py +++ b/tests/contracts/test_contract_constructor_encoding.py @@ -1,12 +1,14 @@ import pytest +from eth_utils import ( + encode_hex, + remove_0x_prefix, +) + from eth_abi import ( encode_abi, ) -from web3.utils.encoding import encode_hex -from web3.utils.formatting import remove_0x_prefix - def test_contract_constructor_abi_encoding_with_no_constructor_fn(MathContract, MATH_CODE): deploy_data = MathContract._encode_constructor_data() diff --git a/tests/contracts/test_contract_deployment.py b/tests/contracts/test_contract_deployment.py index 4444fe0..6ea6c54 100644 --- a/tests/contracts/test_contract_deployment.py +++ b/tests/contracts/test_contract_deployment.py @@ -1,4 +1,6 @@ -from web3.utils.string import force_bytes +from eth_utils import ( + force_bytes, +) def test_contract_deployment_no_constructor(web3, MathContract, diff --git a/tests/contracts/test_contract_estimateGas.py b/tests/contracts/test_contract_estimateGas.py index f5cb7c1..cf87e50 100644 --- a/tests/contracts/test_contract_estimateGas.py +++ b/tests/contracts/test_contract_estimateGas.py @@ -1,6 +1,6 @@ import pytest -from web3.utils.abi import ( +from eth_utils import ( function_abi_to_4byte_selector, ) diff --git a/tests/contracts/test_contract_transact_interface.py b/tests/contracts/test_contract_transact_interface.py index 83a4081..e46615f 100644 --- a/tests/contracts/test_contract_transact_interface.py +++ b/tests/contracts/test_contract_transact_interface.py @@ -2,14 +2,15 @@ import pytest -from web3.utils.transactions import ( - wait_for_transaction_receipt, -) -from web3.utils.string import ( +from eth_utils import ( force_text, force_bytes, ) +from web3.utils.transactions import ( + wait_for_transaction_receipt, +) + @pytest.fixture() def math_contract(web3, MathContract): diff --git a/tests/contracts/test_extracting_event_data.py b/tests/contracts/test_extracting_event_data.py index 2a9a872..43238ef 100644 --- a/tests/contracts/test_extracting_event_data.py +++ b/tests/contracts/test_extracting_event_data.py @@ -1,14 +1,13 @@ import pytest +from eth_utils import ( + force_text, + decode_hex, +) + from web3.utils.events import ( get_event_data, ) -from web3.utils.string import ( - force_text, -) -from web3.utils.encoding import ( - decode_hex, -) @pytest.fixture() diff --git a/tests/eth-module/test_eth_accounts.py b/tests/eth-module/test_eth_accounts.py index bc43041..48ac265 100644 --- a/tests/eth-module/test_eth_accounts.py +++ b/tests/eth-module/test_eth_accounts.py @@ -1,4 +1,4 @@ -from web3.utils.address import ( +from eth_utils import ( is_address, ) diff --git a/tests/eth-module/test_eth_blockNumber.py b/tests/eth-module/test_eth_blockNumber.py index 999b211..a7ffbd6 100644 --- a/tests/eth-module/test_eth_blockNumber.py +++ b/tests/eth-module/test_eth_blockNumber.py @@ -1,4 +1,4 @@ -from web3.utils.types import ( +from eth_utils import ( is_integer, ) diff --git a/tests/eth-module/test_eth_getBlock.py b/tests/eth-module/test_eth_getBlock.py index a8e5e3a..bf7b8df 100644 --- a/tests/eth-module/test_eth_getBlock.py +++ b/tests/eth-module/test_eth_getBlock.py @@ -1,6 +1,6 @@ import pytest -from web3.utils.encoding import is_string +from eth_utils import is_string @pytest.fixture(autouse=True)