Skip to content

Commit

Permalink
add _accounts attr
Browse files Browse the repository at this point in the history
  • Loading branch information
jeannettemcd committed May 24, 2024
1 parent 7d8434c commit e55f3a9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,19 @@ def deployment(new_deployment: Deployment) -> Deployment:
class MockWeb3(Web3):
def __init__(self, provider: BaseProvider):
super().__init__(provider)
accounts_mock = PropertyMock(return_value=[
self._accounts = [
"0x50FF810797f75f6bfbf2227442e0c961a8562F4C",
"0x9e1FfFaBdC50e54e030F6E5F7fC27c7Dd22a3F4e",
"0x5BEB2D3aA2333A524703Af18310AcFf462c04723",
"0x7fBe5C7C4E7a8B52b8aAA44425Fc1c0d0e72c2AA"
])
type(self).eth = PropertyMock(accounts=accounts_mock)

]

@property
def eth(self):
eth_mock = MagicMock()
accounts_mock = PropertyMock(return_value=self._accounts)
type(eth_mock).accounts = accounts_mock
return eth_mock

@pytest.fixture(scope="session")
def web3() -> Web3:
Expand Down

0 comments on commit e55f3a9

Please sign in to comment.