plugins.aea-test-autonomy.aea_
test_
autonomy.fixture_
helpers
This module contains helper classes/functions for fixtures.
tendermint_
port
@pytest.fixture(scope="session")
def tendermint_port() -> int
Get the Tendermint port
abci_
host
@pytest.fixture(scope="session")
def abci_host() -> str
Get the ABCI host
abci_
port
@pytest.fixture(scope="session")
def abci_port() -> int
Get the ABCI port
tendermint
@pytest.fixture(scope="class")
def tendermint(tendermint_port: int,
abci_host: str,
abci_port: int,
timeout: float = 2.0,
max_attempts: int = 10) -> Generator
Launch the Ganache image.
UseTendermint Objects
@pytest.mark.integration
class UseTendermint()
Inherit from this class to use Tendermint.
abci_
host
@property
def abci_host() -> str
Get the abci host address.
abci_
port
@property
def abci_port() -> int
Get the abci port.
node_
address
@property
def node_address() -> str
Get the node address.
nb_
nodes
@pytest.fixture
def nb_nodes(request: Any) -> int
Get a parametrized number of nodes.
flask_
tendermint
@pytest.fixture
def flask_tendermint(
tendermint_port: int,
nb_nodes: int,
abci_host: str,
abci_port: int,
timeout: float = 2.0,
max_attempts: int = 10
) -> Generator[FlaskTendermintDockerImage, None, None]
Launch the Flask server with Tendermint container.
UseFlaskTendermintNode Objects
@pytest.mark.integration
class UseFlaskTendermintNode()
Inherit from this class to use flask server with Tendermint.
p2p_
seeds
@property
def p2p_seeds() -> List[str]
Get the p2p seeds.
get_
node_
name
def get_node_name(i: int) -> str
Get the node's name.
get_
abci_
port
def get_abci_port(i: int) -> int
Get the ith rpc port.
get_
port
def get_port(i: int) -> int
Get the ith port.
get_
com_
port
def get_com_port(i: int) -> int
Get the ith com port.
get_
laddr
def get_laddr(i: int, p2p: bool = False) -> str
Get the ith rpc port.
health_
check
def health_check(**kwargs: Any) -> None
Perform a health check.
ganache_
addr
@pytest.fixture(scope="session")
def ganache_addr() -> str
HTTP address to the Ganache node.
ganache_
port
@pytest.fixture(scope="session")
def ganache_port() -> int
Port of the connection to the Ganache Node to use during the tests.
ganache_
configuration
@pytest.fixture(scope="session")
def ganache_configuration() -> Dict
Get the Ganache configuration for testing purposes.
ganache_
scope_
function
@pytest.fixture(scope="function")
def ganache_scope_function(ganache_configuration: Dict,
ganache_addr: str,
ganache_port: int,
timeout: float = 2.0,
max_attempts: int = 10) -> Generator
Launch the Ganache image. This fixture is scoped to a function which means it will destroyed at the end of the test.
ganache_
scope_
class
@pytest.fixture(scope="class")
def ganache_scope_class(ganache_configuration: Dict,
ganache_addr: str,
ganache_port: int,
timeout: float = 2.0,
max_attempts: int = 10) -> Generator
Launch the Ganache image. This fixture is scoped to a class which means it will destroyed after running every test in a class.
ammnet_
scope_
class
@pytest.fixture(scope="class")
def ammnet_scope_class(timeout: float = 2.0,
max_attempts: int = 26) -> Generator
Launch the Ganache image. This fixture is scoped to a class which means it will destroyed after running every test in a class.
UseGanache Objects
@pytest.mark.integration
class UseGanache()
Inherit from this class to use Ganache.
GanacheBaseTest Objects
class GanacheBaseTest(DockerBaseTest)
Base pytest class for Ganache.
setup_
class_
kwargs
@classmethod
def setup_class_kwargs(cls) -> Dict[str, Any]
Get kwargs for _setup_class call.
key_
pairs
@classmethod
def key_pairs(cls) -> List[Tuple[str, str]]
Get the key pairs which are funded.
url
@classmethod
def url(cls) -> str
Get the url under which the image is reachable.
acn_
config
@pytest.fixture(scope="session")
def acn_config() -> Dict
ACN node configuration.
acn_
node
@pytest.fixture(scope="function")
def acn_node(acn_config: Dict,
timeout: float = 2.0,
max_attempts: int = 10) -> Generator
Launch the Ganache image.
UseACNNode Objects
@pytest.mark.integration
class UseACNNode()
Inherit from this class to use an ACNNode for a client connection
ACNNodeBaseTest Objects
class ACNNodeBaseTest(DockerBaseTest)
Base pytest class for Ganache.
setup_
class_
kwargs
@classmethod
def setup_class_kwargs(cls) -> Dict[str, Any]
Get kwargs for _setup_class call.
url
@classmethod
def url(cls) -> str
Get the url under which the image is reachable.
hardhat_
addr
@pytest.fixture(scope="session")
def hardhat_addr() -> str
Get the hardhat addr
hardhat_
port
@pytest.fixture(scope="session")
def hardhat_port() -> int
Get the hardhat port
key_
pairs
@pytest.fixture(scope="session")
def key_pairs() -> List[Tuple[str, str]]
Get the default key paris for hardhat.
HardHatBaseTest Objects
class HardHatBaseTest(DockerBaseTest)
Base pytest class for HardHat.
setup_
class_
kwargs
@classmethod
def setup_class_kwargs(cls) -> Dict[str, Any]
Get kwargs for _setup_class call.
key_
pairs
@classmethod
def key_pairs(cls) -> List[Tuple[str, str]]
Get the key pairs which are funded.
url
@classmethod
def url(cls) -> str
Get the url under which the image is reachable.
registries_
scope_
class
@pytest.fixture(scope="class")
def registries_scope_class(timeout: float = 2.0,
max_attempts: int = 20) -> Generator
Launch the Registry contracts image. This fixture is scoped to a class which means it will destroyed after running every test in a class.
UseRegistries Objects
@pytest.mark.integration
class UseRegistries()
Inherit from this class to use a local Ethereum network with deployed registry contracts
gnosis_
safe_
hardhat_
scope_
function
@pytest.fixture(scope="function")
def gnosis_safe_hardhat_scope_function(hardhat_addr: str,
hardhat_port: int,
timeout: float = 3.0,
max_attempts: int = 40) -> Generator
Launch the HardHat node with Gnosis Safe contracts deployed. This fixture is scoped to a function which means it will destroyed at the end of the test.
gnosis_
safe_
hardhat_
scope_
class
@pytest.fixture(scope="class")
def gnosis_safe_hardhat_scope_class(hardhat_addr: str,
hardhat_port: int,
timeout: float = 3.0,
max_attempts: int = 40) -> Generator
Launch the HardHat node with Gnosis Safe contracts deployed.This fixture is scoped to a class which means it will destroyed after running every test in a class.
UseGnosisSafeHardHatNet Objects
@pytest.mark.integration
class UseGnosisSafeHardHatNet()
Inherit from this class to use HardHat local net with Gnosis-Safe deployed.
HardHatGnosisBaseTest Objects
class HardHatGnosisBaseTest(HardHatBaseTest)
Base pytest class for HardHat with Gnosis deployed.
HardHatAMMBaseTest Objects
class HardHatAMMBaseTest(HardHatBaseTest)
Base pytest class for HardHat with Gnosis and Uniswap deployed.
RegistriesBaseTest Objects
class RegistriesBaseTest(HardHatBaseTest)
Base pytest class for component registries.
ipfs_
daemon
@pytest.fixture(scope="class")
def ipfs_daemon() -> Iterator[bool]
Starts an IPFS daemon for the tests.
ipfs_
domain
@pytest.fixture(scope="session")
def ipfs_domain() -> str
Get the ipfs domain
UseLocalIpfs Objects
class UseLocalIpfs()
Use local IPFS daemon.