_algopy_testing.context
¶
Module Contents¶
Classes¶
Manages the testing context for Algorand Python SDK (algopy) applications. |
API¶
- class AlgopyTestContext( )¶
Manages the testing context for Algorand Python SDK (algopy) applications.
This class provides methods and properties to simulate various aspects of the Algorand blockchain environment, including accounts, assets, applications, transactions, and global state. It allows for easy setup and manipulation of test scenarios for algopy-based smart contracts and applications.
- Parameters:
default_sender – The default sender account address, defaults to None
template_vars – Dictionary of template variables, defaults to None
Initialization
- property default_sender: algopy.Account¶
Get the default sender account.
- Returns:
The default sender account
- Return type:
algopy.Account
- property any: _algopy_testing.value_generators.AlgopyValueGenerator¶
Access the value generators.
- Returns:
The value generator
- Return type:
- property ledger: _algopy_testing.context_helpers.LedgerContext¶
Access the ledger context.
- Returns:
The ledger context
- Return type:
- property txn: _algopy_testing.context_helpers.TransactionContext¶
Access the transaction context.
- Returns:
The transaction context
- Return type:
- set_template_var(name: str, value: Any) None ¶
Set a template variable for the current context.
- Parameters:
name – The name of the template variable
value – The value to assign to the template variable