aea.test_
tools.test_
contract
This module contains test case classes based on pytest for AEA contract testing.
_
MetaBaseContractTestCase Objects
class _MetaBaseContractTestCase(ABCMeta)
A metaclass that validates BaseContractTestCase's class.
__
new__
def __new__(mcs, name: str, bases: Tuple, namespace: Dict,
**kwargs: Any) -> Type
Initialize the class.
BaseContractTestCase Objects
class BaseContractTestCase(ABC, metaclass=_MetaBaseContractTestCase)
A class to test a contract.
contract
@property
def contract() -> Contract
Get the contract.
setup_
class
@classmethod
def setup_class(cls) -> None
Set up the contract test case class.
setup
@classmethod
def setup(cls, **kwargs: Any) -> None
Set up the contract test case.
finish_
contract_
deployment
@classmethod
@abstractmethod
def finish_contract_deployment(cls) -> str
Finish deploying contract.
Returns:
contract address
refill_
from_
faucet
@staticmethod
def refill_from_faucet(ledger_api: LedgerApi, faucet_api: FaucetApi,
address: str) -> None
Refill from faucet.
sign_
send_
confirm_
receipt_
multisig_
transaction
@staticmethod
def sign_send_confirm_receipt_multisig_transaction(
tx: JSONLike,
ledger_api: LedgerApi,
cryptos: List[Crypto],
sleep_time: float = 2.0) -> JSONLike
Sign, send and confirm settlement of a transaction with multiple signatures.
Arguments:
tx
: the transactionledger_api
: the ledger apicryptos
: Cryptos to sign transaction withsleep_time
: the time to sleep between transaction submission and receipt request
Returns:
The transaction receipt
sign_
send_
confirm_
receipt_
transaction
@classmethod
def sign_send_confirm_receipt_transaction(cls,
tx: JSONLike,
ledger_api: LedgerApi,
crypto: Crypto,
sleep_time: float = 2.0) -> JSONLike
Sign, send and confirm settlement of a transaction with multiple signatures.
Arguments:
tx
: the transactionledger_api
: the ledger apicrypto
: Crypto to sign transaction withsleep_time
: the time to sleep between transaction submission and receipt request
Returns:
The transaction receipt