algorand-python-testing 0.3.0b8__tar.gz → 0.3.0b9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/CHANGELOG.md +2 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/PKG-INFO +1 -1
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/pyproject.toml +1 -1
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/context_helpers/context_storage.py +2 -2
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/context_helpers/ledger_context.py +21 -21
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/context_helpers/txn_context.py +2 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/models/account.py +1 -1
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/models/application.py +8 -16
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/models/asset.py +10 -29
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/op/global_values.py +2 -4
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/op/misc.py +7 -9
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/utils.py +22 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/value_generators/avm.py +7 -7
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/models/test_asset.py +1 -3
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/test_context.py +7 -7
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.coveragerc +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.editorconfig +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.github/pull_request_template.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.github/workflows/cd.yaml +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.github/workflows/ci.yaml +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.github/workflows/gh-pages.yaml +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.gitignore +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.pre-commit-config.yaml +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.vscode/extensions.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.vscode/launch.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.vscode/settings.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/CONTRIBUTING.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/LICENSE +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/README.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/Makefile +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/_static/custom.css +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/algopy.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/api.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/conf.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/coverage.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/examples.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/glossary.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/index.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/make.bat +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/arc4-types.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/avm-types.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/concepts.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/contract-testing.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/index.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/opcodes.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/signature-testing.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/state-management.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/subroutines.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/transactions.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/README.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/auction/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/auction/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/auction/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/htlc_logicsig/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/htlc_logicsig/signature.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/htlc_logicsig/test_signature.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/marketplace/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/marketplace/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/marketplace/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/proof_of_attendance/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/proof_of_attendance/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/proof_of_attendance/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/scratch_storage/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/scratch_storage/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/scratch_storage/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/simple_voting/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/simple_voting/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/simple_voting/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/zk_whitelist/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/zk_whitelist/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/zk_whitelist/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/scripts/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/scripts/check_stubs_cov.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/scripts/refresh_test_artifacts.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/scripts/validate_examples.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/arc4.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/compiled.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/constants.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/context.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/context_helpers/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/decorators/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/decorators/arc4.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/decorators/subroutine.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/enums.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/gtxn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/itxn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/itxn_loader.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/models/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/models/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/models/logicsig.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/models/template_variable.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/models/txn_fields.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/models/unsigned_builtins.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/mutable.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/op/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/op/block.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/op/constants.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/op/crypto.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/op/itxn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/op/pure.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/op/txn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/primitives/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/primitives/biguint.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/primitives/bytes.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/primitives/string.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/primitives/uint64.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/protocols.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/py.typed +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/state/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/state/box.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/state/global_state.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/state/local_state.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/state/utils.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/utilities/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/utilities/budget.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/utilities/log.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/value_generators/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/value_generators/arc4.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/value_generators/txn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/algopy/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/algopy/arc4.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/algopy/gtxn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/algopy/itxn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/algopy/op.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/algopy/py.typed +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/algopy_testing/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/algopy_testing/py.typed +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/templates/.macros.j2 +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/templates/.release_notes.md.j2 +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/templates/CHANGELOG.md.j2 +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/conftest.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/test_abi_call.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/test_address.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/test_arc4_method_signature.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/test_bool.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/test_dynamic_array.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/test_dynamic_bytes.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/test_emit.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/test_static_array.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/test_string.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/test_struct.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/test_tuple.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/test_ufixednxm.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/arc4/test_uintn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4ABIMethod/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4ABIMethod/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4InnerTxns/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4InnerTxns/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4PrimitiveOps/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4PrimitiveOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/BoxContract/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/BoxContract/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/BoxContract/data/BoxContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/BoxContract/data/BoxContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/BoxContract/data/BoxContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/CryptoOps/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/CryptoOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/CryptoOps/data/CryptoOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/CryptoOps/data/CryptoOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/CryptoOps/data/CryptoOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/GlobalStateValidator/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/GlobalStateValidator/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/MiscellaneousOps/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/MiscellaneousOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/PrimitiveOps/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/PrimitiveOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateMutations/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateMutations/data/Contract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateMutations/data/Contract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateMutations/data/Contract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateMutations/statemutations.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/GlobalStateContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/GlobalStateContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/GlobalStateContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/ITxnOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/ITxnOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/ITxnOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/LocalStateContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/LocalStateContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/LocalStateContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAcctParamsGet.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAcctParamsGet.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAcctParamsGet.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppGlobalContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppGlobalContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppGlobalContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppGlobalExContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppGlobalExContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppGlobalExContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppLocalContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppLocalContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppLocalContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppLocalExContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppLocalExContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppLocalExContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppParamsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppParamsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAppParamsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAssetHoldingContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAssetHoldingContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAssetHoldingContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAssetParamsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAssetParamsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/StateOps/data/StateAssetParamsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/artifacts/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/common.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/conftest.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/contexts/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/models/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/models/test_box.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/models/test_box_map.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/models/test_box_ref.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/models/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/models/test_uenumerate.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/models/test_urange.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/primitives/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/primitives/conftest.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/primitives/test_biguint.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/primitives/test_bytes.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/primitives/test_string.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/primitives/test_uint64.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/state/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/state/conftest.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/state/test_global_state.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/state/test_local_state.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/state/test_mutations.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/test_miscellaneous_op.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/test_op.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/util.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/utilities/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/utilities/conftest.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/utilities/test_log.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/value_generators/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/value_generators/test_avm.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: algorand-python-testing
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.0b9
|
|
4
4
|
Summary: Algorand Python testing library
|
|
5
5
|
Project-URL: Documentation, https://github.com/algorandfoundation/puya/tree/main/algopy_testing#README.md
|
|
6
6
|
Project-URL: Issues, https://github.com/algorandfoundation/puya/issues
|
|
@@ -78,13 +78,13 @@ class _InternalContext:
|
|
|
78
78
|
|
|
79
79
|
def get_asset_data(self, asset_id: int | algopy.UInt64) -> AssetFields:
|
|
80
80
|
try:
|
|
81
|
-
return self.ledger.
|
|
81
|
+
return self.ledger._asset_data[int(asset_id)]
|
|
82
82
|
except KeyError:
|
|
83
83
|
raise ValueError("Unknown asset, check correct testing context is active") from None
|
|
84
84
|
|
|
85
85
|
def get_account_data(self, account_public_key: str) -> AccountContextData:
|
|
86
86
|
try:
|
|
87
|
-
return self.ledger.
|
|
87
|
+
return self.ledger._account_data[account_public_key]
|
|
88
88
|
except KeyError:
|
|
89
89
|
raise ValueError("Unknown account, check correct testing context is active") from None
|
|
90
90
|
|
|
@@ -23,25 +23,25 @@ class LedgerContext:
|
|
|
23
23
|
def __init__(self) -> None:
|
|
24
24
|
from _algopy_testing.models.account import AccountContextData, get_empty_account
|
|
25
25
|
|
|
26
|
-
self.
|
|
27
|
-
self.
|
|
28
|
-
self.
|
|
29
|
-
self.
|
|
30
|
-
self.
|
|
26
|
+
self._account_data = defaultdict[str, AccountContextData](get_empty_account)
|
|
27
|
+
self._app_data: dict[int, ApplicationContextData] = {}
|
|
28
|
+
self._asset_data: dict[int, AssetFields] = {}
|
|
29
|
+
self._blocks: dict[int, dict[str, int]] = {}
|
|
30
|
+
self._global_fields: GlobalFields = get_default_global_fields()
|
|
31
31
|
|
|
32
32
|
self._asset_id = iter(range(1001, 2**64))
|
|
33
33
|
self._app_id = iter(range(1001, 2**64))
|
|
34
34
|
|
|
35
|
-
def
|
|
35
|
+
def _get_next_asset_id(self) -> int:
|
|
36
36
|
while True:
|
|
37
37
|
asset_id = next(self._asset_id)
|
|
38
|
-
if asset_id not in self.
|
|
38
|
+
if asset_id not in self._asset_data:
|
|
39
39
|
return asset_id
|
|
40
40
|
|
|
41
|
-
def
|
|
41
|
+
def _get_next_app_id(self) -> int:
|
|
42
42
|
while True:
|
|
43
43
|
app_id = next(self._app_id)
|
|
44
|
-
if app_id not in self.
|
|
44
|
+
if app_id not in self._app_data:
|
|
45
45
|
return app_id
|
|
46
46
|
|
|
47
47
|
def get_account(self, address: str) -> algopy.Account:
|
|
@@ -68,7 +68,7 @@ class LedgerContext:
|
|
|
68
68
|
bool: True if the account exists, False otherwise.
|
|
69
69
|
"""
|
|
70
70
|
assert_address_is_valid(address)
|
|
71
|
-
return address in self.
|
|
71
|
+
return address in self._account_data
|
|
72
72
|
|
|
73
73
|
def update_account(
|
|
74
74
|
self,
|
|
@@ -84,11 +84,11 @@ class LedgerContext:
|
|
|
84
84
|
**account_fields: The fields to update.
|
|
85
85
|
"""
|
|
86
86
|
assert_address_is_valid(address)
|
|
87
|
-
self.
|
|
87
|
+
self._account_data[address].fields.update(account_fields)
|
|
88
88
|
|
|
89
89
|
if opted_asset_balances is not None:
|
|
90
90
|
for asset_id, balance in opted_asset_balances.items():
|
|
91
|
-
self.
|
|
91
|
+
self._account_data[address].opted_asset_balances[UInt64(asset_id)] = balance
|
|
92
92
|
|
|
93
93
|
def get_asset(self, asset_id: algopy.UInt64 | int) -> algopy.Asset:
|
|
94
94
|
"""Get an asset by ID.
|
|
@@ -105,7 +105,7 @@ class LedgerContext:
|
|
|
105
105
|
import algopy
|
|
106
106
|
|
|
107
107
|
asset_id = int(asset_id) if isinstance(asset_id, algopy.UInt64) else asset_id
|
|
108
|
-
if asset_id not in self.
|
|
108
|
+
if asset_id not in self._asset_data:
|
|
109
109
|
raise ValueError("Asset not found in testing context!")
|
|
110
110
|
|
|
111
111
|
return algopy.Asset(asset_id)
|
|
@@ -122,7 +122,7 @@ class LedgerContext:
|
|
|
122
122
|
import algopy
|
|
123
123
|
|
|
124
124
|
asset_id = int(asset_id) if isinstance(asset_id, algopy.UInt64) else asset_id
|
|
125
|
-
return asset_id in self.
|
|
125
|
+
return asset_id in self._asset_data
|
|
126
126
|
|
|
127
127
|
def update_asset(self, asset_id: int, **asset_fields: typing.Unpack[AssetFields]) -> None:
|
|
128
128
|
"""Update asset fields.
|
|
@@ -134,9 +134,9 @@ class LedgerContext:
|
|
|
134
134
|
Raises:
|
|
135
135
|
ValueError: If the asset is not found.
|
|
136
136
|
"""
|
|
137
|
-
if asset_id not in self.
|
|
137
|
+
if asset_id not in self._asset_data:
|
|
138
138
|
raise ValueError("Asset not found in testing context!")
|
|
139
|
-
self.
|
|
139
|
+
self._asset_data[asset_id].update(asset_fields)
|
|
140
140
|
|
|
141
141
|
def get_app(
|
|
142
142
|
self, app_id: algopy.Contract | algopy.Application | algopy.UInt64 | int
|
|
@@ -164,7 +164,7 @@ class LedgerContext:
|
|
|
164
164
|
bool: True if the application exists, False otherwise.
|
|
165
165
|
"""
|
|
166
166
|
app_id = _get_app_id(app_id)
|
|
167
|
-
return app_id in self.
|
|
167
|
+
return app_id in self._app_data
|
|
168
168
|
|
|
169
169
|
def update_app(
|
|
170
170
|
self, app_id: int, **application_fields: typing.Unpack[ApplicationFields]
|
|
@@ -343,7 +343,7 @@ class LedgerContext:
|
|
|
343
343
|
seed (algopy.UInt64 | int): The block seed.
|
|
344
344
|
timestamp (algopy.UInt64 | int): The block timestamp.
|
|
345
345
|
"""
|
|
346
|
-
self.
|
|
346
|
+
self._blocks[index] = {"seed": int(seed), "timestamp": int(timestamp)}
|
|
347
347
|
|
|
348
348
|
def get_block_content(self, index: int, key: str) -> int:
|
|
349
349
|
"""Get block content.
|
|
@@ -358,7 +358,7 @@ class LedgerContext:
|
|
|
358
358
|
Raises:
|
|
359
359
|
ValueError: If the block content is not found.
|
|
360
360
|
"""
|
|
361
|
-
content = self.
|
|
361
|
+
content = self._blocks.get(index, {}).get(key, None)
|
|
362
362
|
if content is None:
|
|
363
363
|
raise KeyError(
|
|
364
364
|
f"Block content for index {index} and key {key} not found in testing context!"
|
|
@@ -383,7 +383,7 @@ class LedgerContext:
|
|
|
383
383
|
f"Invalid field(s) found during patch for `Global`: {', '.join(invalid_keys)}"
|
|
384
384
|
)
|
|
385
385
|
|
|
386
|
-
self.
|
|
386
|
+
self._global_fields.update(global_fields)
|
|
387
387
|
|
|
388
388
|
def _get_app_data(
|
|
389
389
|
self, app: algopy.UInt64 | algopy.Application | algopy.Contract | int
|
|
@@ -401,7 +401,7 @@ class LedgerContext:
|
|
|
401
401
|
"""
|
|
402
402
|
app_id = _get_app_id(app)
|
|
403
403
|
try:
|
|
404
|
-
return self.
|
|
404
|
+
return self._app_data[app_id]
|
|
405
405
|
except KeyError:
|
|
406
406
|
raise ValueError("Unknown app id, is there an active transaction?") from None
|
|
407
407
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import contextlib
|
|
4
|
+
import time
|
|
4
5
|
import typing
|
|
5
6
|
|
|
6
7
|
import algosdk
|
|
@@ -207,6 +208,7 @@ class TransactionGroup:
|
|
|
207
208
|
active_txn_index: int | None = None,
|
|
208
209
|
active_txn_overrides: dict[str, typing.Any] | None = None,
|
|
209
210
|
):
|
|
211
|
+
self._latest_timestamp = int(time.time())
|
|
210
212
|
self._set_txn_group(txns, active_txn_index)
|
|
211
213
|
self._itxn_groups: list[Sequence[InnerTransactionResultType]] = []
|
|
212
214
|
self._constructing_itxn_group: list[InnerTransaction] = []
|
|
@@ -82,7 +82,7 @@ class Account(BytesBacked):
|
|
|
82
82
|
def data(self) -> AccountContextData:
|
|
83
83
|
from _algopy_testing.context_helpers import lazy_context
|
|
84
84
|
|
|
85
|
-
return lazy_context.
|
|
85
|
+
return lazy_context.get_account_data(self.public_key)
|
|
86
86
|
|
|
87
87
|
@property
|
|
88
88
|
def balance(self) -> algopy.UInt64:
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import inspect
|
|
4
3
|
import typing
|
|
5
4
|
|
|
6
5
|
from _algopy_testing.primitives import UInt64
|
|
7
6
|
from _algopy_testing.protocols import UInt64Backed
|
|
8
|
-
from _algopy_testing.utils import as_int64
|
|
7
|
+
from _algopy_testing.utils import as_int64, resolve_app_index
|
|
9
8
|
|
|
10
9
|
if typing.TYPE_CHECKING:
|
|
11
10
|
from collections.abc import Sequence
|
|
@@ -70,22 +69,15 @@ class Application(UInt64Backed):
|
|
|
70
69
|
def fields(self) -> ApplicationFields:
|
|
71
70
|
from _algopy_testing.context_helpers import lazy_context
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
raise ValueError("cannot access properties of an app with an id of 0") from None
|
|
75
|
-
return lazy_context.get_app_data(self._id).fields
|
|
72
|
+
return lazy_context.get_app_data(resolve_app_index(self._id)).fields
|
|
76
73
|
|
|
77
74
|
def __getattr__(self, name: str) -> typing.Any:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
f"Make sure to patch the field '{name}' using your `AlgopyTestContext` "
|
|
85
|
-
"instance."
|
|
86
|
-
)
|
|
87
|
-
return value
|
|
88
|
-
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")
|
|
75
|
+
try:
|
|
76
|
+
return self.fields[name] # type: ignore[literal-required]
|
|
77
|
+
except KeyError:
|
|
78
|
+
raise AttributeError(
|
|
79
|
+
f"'{self.__class__.__name__}' object has no attribute '{name}'"
|
|
80
|
+
) from None
|
|
89
81
|
|
|
90
82
|
def __eq__(self, other: object) -> bool:
|
|
91
83
|
if isinstance(other, Application):
|
|
@@ -3,6 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
5
|
from _algopy_testing.protocols import UInt64Backed
|
|
6
|
+
from _algopy_testing.utils import resolve_asset_index
|
|
6
7
|
|
|
7
8
|
if typing.TYPE_CHECKING:
|
|
8
9
|
import algopy
|
|
@@ -65,39 +66,19 @@ class Asset(UInt64Backed):
|
|
|
65
66
|
"Please mock this method using your python testing framework of choice."
|
|
66
67
|
)
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
@property
|
|
70
|
+
def fields(self) -> AssetFields:
|
|
69
71
|
from _algopy_testing.context_helpers import lazy_context
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
# check if its not 0 (which means its not
|
|
73
|
-
# instantiated/opted-in yet, and instantiated directly
|
|
74
|
-
# without invoking any_asset).
|
|
75
|
-
if self.id == 0:
|
|
76
|
-
# Handle dunder methods specially
|
|
77
|
-
if name.startswith("__") and name.endswith("__"):
|
|
78
|
-
return getattr(type(self), name)
|
|
79
|
-
# For non-dunder attributes, check in __dict__
|
|
80
|
-
if name in self.__dict__:
|
|
81
|
-
return self.__dict__[name]
|
|
82
|
-
raise AttributeError(
|
|
83
|
-
f"'{self.__class__.__name__}' object has no attribute '{name}'"
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
raise ValueError(
|
|
87
|
-
"`algopy.Asset` is not present in the test context! "
|
|
88
|
-
"Use `context.add_asset()` or `context.any.asset()` to add the asset to "
|
|
89
|
-
"your test setup."
|
|
90
|
-
)
|
|
73
|
+
return lazy_context.get_asset_data(resolve_asset_index(self.id))
|
|
91
74
|
|
|
92
|
-
|
|
93
|
-
|
|
75
|
+
def __getattr__(self, name: str) -> typing.Any:
|
|
76
|
+
try:
|
|
77
|
+
return self.fields[name] # type: ignore[literal-required]
|
|
78
|
+
except KeyError:
|
|
94
79
|
raise AttributeError(
|
|
95
|
-
f"
|
|
96
|
-
|
|
97
|
-
"instance."
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
return return_value
|
|
80
|
+
f"'{self.__class__.__name__}' object has no attribute '{name}'"
|
|
81
|
+
) from None
|
|
101
82
|
|
|
102
83
|
def __eq__(self, other: object) -> bool:
|
|
103
84
|
if isinstance(other, Asset):
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import time
|
|
4
3
|
import typing
|
|
5
4
|
from typing import TypedDict, TypeVar
|
|
6
5
|
|
|
@@ -38,7 +37,7 @@ class GlobalFields(TypedDict, total=False):
|
|
|
38
37
|
class _Global:
|
|
39
38
|
@property
|
|
40
39
|
def _fields(self) -> GlobalFields:
|
|
41
|
-
return lazy_context.ledger.
|
|
40
|
+
return lazy_context.ledger._global_fields
|
|
42
41
|
|
|
43
42
|
@property
|
|
44
43
|
def current_application_address(self) -> algopy.Account:
|
|
@@ -60,8 +59,7 @@ class _Global:
|
|
|
60
59
|
try:
|
|
61
60
|
return self._fields["latest_timestamp"]
|
|
62
61
|
except KeyError:
|
|
63
|
-
|
|
64
|
-
return UInt64(int(time.time()))
|
|
62
|
+
return UInt64(lazy_context.active_group._latest_timestamp)
|
|
65
63
|
|
|
66
64
|
@property
|
|
67
65
|
def group_size(self) -> algopy.UInt64:
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/op/misc.py
RENAMED
|
@@ -10,7 +10,11 @@ from _algopy_testing.enums import TransactionType
|
|
|
10
10
|
from _algopy_testing.models import Account, Application, Asset
|
|
11
11
|
from _algopy_testing.primitives.bytes import Bytes
|
|
12
12
|
from _algopy_testing.primitives.uint64 import UInt64
|
|
13
|
-
from _algopy_testing.utils import
|
|
13
|
+
from _algopy_testing.utils import (
|
|
14
|
+
raise_mocked_function_error,
|
|
15
|
+
resolve_app_index,
|
|
16
|
+
resolve_asset_index,
|
|
17
|
+
)
|
|
14
18
|
|
|
15
19
|
if typing.TYPE_CHECKING:
|
|
16
20
|
import algopy
|
|
@@ -23,10 +27,7 @@ def err() -> None:
|
|
|
23
27
|
def _get_app(app: algopy.Application | algopy.UInt64 | int) -> Application:
|
|
24
28
|
if isinstance(app, Application):
|
|
25
29
|
return app
|
|
26
|
-
|
|
27
|
-
return lazy_context.ledger.get_app(app)
|
|
28
|
-
txn = lazy_context.active_group.active_txn
|
|
29
|
-
return txn.apps(app)
|
|
30
|
+
return lazy_context.ledger.get_app(resolve_app_index(app))
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
def _get_account(acc: algopy.Account | algopy.UInt64 | int) -> Account:
|
|
@@ -39,10 +40,7 @@ def _get_account(acc: algopy.Account | algopy.UInt64 | int) -> Account:
|
|
|
39
40
|
def _get_asset(asset: algopy.Asset | algopy.UInt64 | int) -> Asset:
|
|
40
41
|
if isinstance(asset, Asset):
|
|
41
42
|
return asset
|
|
42
|
-
|
|
43
|
-
return lazy_context.ledger.get_asset(asset)
|
|
44
|
-
txn = lazy_context.active_group.active_txn
|
|
45
|
-
return txn.assets(asset)
|
|
43
|
+
return lazy_context.ledger.get_asset(resolve_asset_index(asset))
|
|
46
44
|
|
|
47
45
|
|
|
48
46
|
def _get_bytes(b: algopy.Bytes | bytes) -> bytes:
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/src/_algopy_testing/utils.py
RENAMED
|
@@ -29,6 +29,28 @@ if TYPE_CHECKING:
|
|
|
29
29
|
from _algopy_testing.op.global_values import GlobalFields
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
def resolve_app_index(app_id_or_index: algopy.UInt64 | int) -> int:
|
|
33
|
+
from _algopy_testing.context_helpers import lazy_context
|
|
34
|
+
|
|
35
|
+
if app_id_or_index >= 1001:
|
|
36
|
+
app_id = app_id_or_index
|
|
37
|
+
else:
|
|
38
|
+
txn = lazy_context.active_group.active_txn
|
|
39
|
+
app_id = txn.apps(app_id_or_index).id
|
|
40
|
+
return int(app_id)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def resolve_asset_index(asset_id_or_index: algopy.UInt64 | int) -> int:
|
|
44
|
+
from _algopy_testing.context_helpers import lazy_context
|
|
45
|
+
|
|
46
|
+
if asset_id_or_index >= 1001:
|
|
47
|
+
asset_id = asset_id_or_index
|
|
48
|
+
else:
|
|
49
|
+
txn = lazy_context.active_group.active_txn
|
|
50
|
+
asset_id = txn.assets(asset_id_or_index).id
|
|
51
|
+
return int(asset_id)
|
|
52
|
+
|
|
53
|
+
|
|
32
54
|
def generate_random_int(min_value: int, max_value: int) -> int:
|
|
33
55
|
return secrets.randbelow(max_value - min_value + 1) + min_value
|
|
34
56
|
|
|
@@ -98,7 +98,7 @@ class AVMValueGenerator:
|
|
|
98
98
|
new_account_address = address or algosdk.account.generate_account()[1]
|
|
99
99
|
new_account = algopy.Account(new_account_address)
|
|
100
100
|
# defaultdict of account_data ensures we get a new initialized account
|
|
101
|
-
account_data = lazy_context.
|
|
101
|
+
account_data = lazy_context.get_account_data(new_account_address)
|
|
102
102
|
# update so defaults are preserved
|
|
103
103
|
account_data.fields.update(account_fields)
|
|
104
104
|
# can set these since it is a new account
|
|
@@ -112,14 +112,14 @@ class AVMValueGenerator:
|
|
|
112
112
|
r"""Generate and add a new asset with a unique ID."""
|
|
113
113
|
import algopy
|
|
114
114
|
|
|
115
|
-
if asset_id and asset_id in lazy_context.ledger.
|
|
115
|
+
if asset_id and asset_id in lazy_context.ledger._asset_data:
|
|
116
116
|
raise ValueError("Asset with such ID already exists in testing context!")
|
|
117
117
|
|
|
118
118
|
for key in asset_fields:
|
|
119
119
|
if key not in AssetFields.__annotations__:
|
|
120
120
|
raise AttributeError(f"Invalid field '{key}' for Asset")
|
|
121
121
|
|
|
122
|
-
new_asset = algopy.Asset(asset_id or lazy_context.ledger.
|
|
122
|
+
new_asset = algopy.Asset(asset_id or lazy_context.ledger._get_next_asset_id())
|
|
123
123
|
default_asset_fields = {
|
|
124
124
|
"total": lazy_context.any.uint64(),
|
|
125
125
|
"decimals": lazy_context.any.uint64(1, 6),
|
|
@@ -135,7 +135,7 @@ class AVMValueGenerator:
|
|
|
135
135
|
"reserve": algopy.Account(algosdk.constants.ZERO_ADDRESS),
|
|
136
136
|
}
|
|
137
137
|
merged_fields = dict(ChainMap(asset_fields, default_asset_fields)) # type: ignore[arg-type]
|
|
138
|
-
lazy_context.ledger.
|
|
138
|
+
lazy_context.ledger._asset_data[int(new_asset.id)] = AssetFields(**merged_fields) # type: ignore[typeddict-item]
|
|
139
139
|
return new_asset
|
|
140
140
|
|
|
141
141
|
def application( # type: ignore[misc]
|
|
@@ -147,9 +147,9 @@ class AVMValueGenerator:
|
|
|
147
147
|
) -> algopy.Application:
|
|
148
148
|
r"""Generate and add a new application with a unique ID."""
|
|
149
149
|
|
|
150
|
-
new_app_id = id if id is not None else lazy_context.ledger.
|
|
150
|
+
new_app_id = id if id is not None else lazy_context.ledger._get_next_app_id()
|
|
151
151
|
|
|
152
|
-
if new_app_id in lazy_context.ledger.
|
|
152
|
+
if new_app_id in lazy_context.ledger._app_data:
|
|
153
153
|
raise ValueError(
|
|
154
154
|
f"Application id {new_app_id} has already been configured in test context!"
|
|
155
155
|
)
|
|
@@ -184,7 +184,7 @@ class AVMValueGenerator:
|
|
|
184
184
|
raise TypeError(f"incorrect type for {field!r}")
|
|
185
185
|
app_fields[field] = value # type: ignore[literal-required]
|
|
186
186
|
|
|
187
|
-
lazy_context.ledger.
|
|
187
|
+
lazy_context.ledger._app_data[new_app_id] = ApplicationContextData(
|
|
188
188
|
fields=app_fields,
|
|
189
189
|
app_id=new_app_id,
|
|
190
190
|
logs=logs or [],
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/tests/models/test_asset.py
RENAMED
|
@@ -88,9 +88,7 @@ def test_asset_attributes(context: AlgopyTestContext) -> None:
|
|
|
88
88
|
def test_asset_attribute_error(context: AlgopyTestContext) -> None:
|
|
89
89
|
asset = context.any.asset()
|
|
90
90
|
|
|
91
|
-
with pytest.raises(
|
|
92
|
-
AttributeError, match="The value for 'non_existent' in the test context is None"
|
|
93
|
-
):
|
|
91
|
+
with pytest.raises(AttributeError, match="'Asset' object has no attribute 'non_existent'"):
|
|
94
92
|
asset.non_existent # noqa: B018
|
|
95
93
|
|
|
96
94
|
|
|
@@ -18,8 +18,8 @@ _ARC4_PREFIX_LEN = 2
|
|
|
18
18
|
def test_patch_global_fields() -> None:
|
|
19
19
|
with algopy_testing_context() as context:
|
|
20
20
|
context.ledger.patch_global_fields(min_txn_fee=UInt64(100), min_balance=UInt64(10))
|
|
21
|
-
assert context.ledger.
|
|
22
|
-
assert context.ledger.
|
|
21
|
+
assert context.ledger._global_fields["min_txn_fee"] == 100
|
|
22
|
+
assert context.ledger._global_fields["min_balance"] == 10
|
|
23
23
|
|
|
24
24
|
with pytest.raises(AttributeError, match="InvalidField"):
|
|
25
25
|
context.ledger.patch_global_fields(InvalidField=123) # type: ignore # noqa: PGH003
|
|
@@ -112,14 +112,14 @@ def test_context_reset() -> None:
|
|
|
112
112
|
clear_state_program=Bytes(b"TestClear"),
|
|
113
113
|
)
|
|
114
114
|
context.reset()
|
|
115
|
-
assert len(context.ledger.
|
|
116
|
-
assert len(context.ledger.
|
|
117
|
-
assert len(context.ledger.
|
|
115
|
+
assert len(context.ledger._account_data) == 0
|
|
116
|
+
assert len(context.ledger._asset_data) == 0
|
|
117
|
+
assert len(context.ledger._app_data) == 0
|
|
118
118
|
with pytest.raises(ValueError, match="No group transactions found"):
|
|
119
119
|
assert context.txn.last_group
|
|
120
120
|
assert len(context.txn._groups) == 0
|
|
121
|
-
assert context.ledger.
|
|
122
|
-
assert context.ledger.
|
|
121
|
+
assert context.ledger._get_next_asset_id() == 1001
|
|
122
|
+
assert context.ledger._get_next_app_id() == 1001
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
def test_algopy_testing_context() -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.github/pull_request_template.md
RENAMED
|
File without changes
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.github/workflows/cd.yaml
RENAMED
|
File without changes
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.github/workflows/ci.yaml
RENAMED
|
File without changes
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/.github/workflows/gh-pages.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/arc4-types.md
RENAMED
|
File without changes
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/avm-types.md
RENAMED
|
File without changes
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/concepts.md
RENAMED
|
File without changes
|
|
File without changes
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/index.md
RENAMED
|
File without changes
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/docs/testing-guide/opcodes.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/auction/__init__.py
RENAMED
|
File without changes
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/auction/contract.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/marketplace/__init__.py
RENAMED
|
File without changes
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b9}/examples/marketplace/contract.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|