mirror of https://github.com/nucypher/nucypher.git
Fix ordering in failing tests - chain id needs to be set before creating EthereumClient.
parent
49af6cbefd
commit
a0f21e8f4d
|
@ -10,11 +10,11 @@ CHAIN_ID = 23
|
|||
@pytest.mark.parametrize("chain_id_return_value", [hex(CHAIN_ID), CHAIN_ID])
|
||||
def test_cached_chain_id(mocker, chain_id_return_value):
|
||||
web3_mock = mocker.MagicMock()
|
||||
mock_client = EthereumClient(w3=web3_mock)
|
||||
|
||||
chain_id_property_mock = PropertyMock(return_value=chain_id_return_value)
|
||||
type(web3_mock.eth).chain_id = chain_id_property_mock
|
||||
|
||||
mock_client = EthereumClient(w3=web3_mock)
|
||||
|
||||
assert mock_client.chain_id == CHAIN_ID
|
||||
chain_id_property_mock.assert_called_once()
|
||||
|
||||
|
|
|
@ -15,11 +15,11 @@ CHAIN_ID = 11155111 # pretend to be sepolia
|
|||
@pytest.mark.parametrize("chain_id_return_value", [hex(CHAIN_ID), CHAIN_ID])
|
||||
def test_cached_chain_id(mocker, chain_id_return_value):
|
||||
web3_mock = mocker.MagicMock()
|
||||
mock_client = EthereumClient(w3=web3_mock)
|
||||
|
||||
chain_id_property_mock = PropertyMock(return_value=chain_id_return_value)
|
||||
type(web3_mock.eth).chain_id = chain_id_property_mock
|
||||
|
||||
mock_client = EthereumClient(w3=web3_mock)
|
||||
|
||||
assert mock_client.chain_id == CHAIN_ID
|
||||
chain_id_property_mock.assert_called_once()
|
||||
|
||||
|
|
Loading…
Reference in New Issue