algorand-python-testing 0.3.0b5__tar.gz → 0.3.0b6__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.0b5 → algorand_python_testing-0.3.0b6}/CHANGELOG.md +30 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/PKG-INFO +10 -3
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/README.md +9 -2
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/docs/_static/custom.css +2 -1
- algorand_python_testing-0.3.0b6/docs/algopy.md +9 -0
- algorand_python_testing-0.3.0b6/docs/api.md +14 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/docs/conf.py +28 -4
- algorand_python_testing-0.3.0b6/docs/coverage.md +162 -0
- algorand_python_testing-0.3.0b6/docs/examples.md +13 -0
- algorand_python_testing-0.3.0b6/docs/glossary.md +8 -0
- algorand_python_testing-0.3.0b6/docs/index.md +198 -0
- algorand_python_testing-0.3.0b6/docs/testing-guide/arc4-types.md +97 -0
- algorand_python_testing-0.3.0b6/docs/testing-guide/avm-types.md +225 -0
- algorand_python_testing-0.3.0b6/docs/testing-guide/concepts.md +58 -0
- algorand_python_testing-0.3.0b6/docs/testing-guide/contract-testing.md +225 -0
- algorand_python_testing-0.3.0b6/docs/testing-guide/index.md +67 -0
- algorand_python_testing-0.3.0b6/docs/testing-guide/opcodes.md +387 -0
- algorand_python_testing-0.3.0b6/docs/testing-guide/signature-testing.md +74 -0
- algorand_python_testing-0.3.0b6/docs/testing-guide/state-management.md +105 -0
- algorand_python_testing-0.3.0b6/docs/testing-guide/subroutines.md +62 -0
- algorand_python_testing-0.3.0b6/docs/testing-guide/transactions.md +200 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/pyproject.toml +22 -3
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/__init__.py +9 -1
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_context_helpers/ledger_context.py +2 -3
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_value_generators/avm.py +18 -1
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/common.py +3 -3
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/state/test_mutations.py +0 -1
- algorand_python_testing-0.3.0b6/tests/value_generators/__init__.py +0 -0
- algorand_python_testing-0.3.0b5/docs/coverage.md +0 -43
- algorand_python_testing-0.3.0b5/docs/examples.md +0 -11
- algorand_python_testing-0.3.0b5/docs/index.md +0 -117
- algorand_python_testing-0.3.0b5/docs/usage.md +0 -292
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/.coveragerc +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/.editorconfig +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/.github/pull_request_template.md +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/.github/workflows/cd.yaml +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/.github/workflows/ci.yaml +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/.github/workflows/gh-pages.yaml +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/.gitignore +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/.pre-commit-config.yaml +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/.vscode/extensions.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/.vscode/launch.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/.vscode/settings.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/CONTRIBUTING.md +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/LICENSE +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/docs/Makefile +0 -0
- {algorand_python_testing-0.3.0b5/examples → algorand_python_testing-0.3.0b6/docs}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/docs/make.bat +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/README.md +0 -0
- {algorand_python_testing-0.3.0b5/examples/auction → algorand_python_testing-0.3.0b6/examples}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5/examples/htlc_logicsig → algorand_python_testing-0.3.0b6/examples/auction}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/auction/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/auction/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b5/examples/marketplace → algorand_python_testing-0.3.0b6/examples/htlc_logicsig}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/htlc_logicsig/signature.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/htlc_logicsig/test_signature.py +0 -0
- {algorand_python_testing-0.3.0b5/examples/proof_of_attendance → algorand_python_testing-0.3.0b6/examples/marketplace}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/marketplace/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/marketplace/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b5/examples/scratch_storage → algorand_python_testing-0.3.0b6/examples/proof_of_attendance}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/proof_of_attendance/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/proof_of_attendance/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b5/examples/simple_voting → algorand_python_testing-0.3.0b6/examples/scratch_storage}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/scratch_storage/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/scratch_storage/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b5/examples/zk_whitelist → algorand_python_testing-0.3.0b6/examples/simple_voting}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/simple_voting/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/simple_voting/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b5/scripts → algorand_python_testing-0.3.0b6/examples/zk_whitelist}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/zk_whitelist/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/examples/zk_whitelist/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b5/tests → algorand_python_testing-0.3.0b6/scripts}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/scripts/check_stubs_cov.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/scripts/refresh_test_artifacts.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/scripts/validate_examples.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy/arc4.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy/gtxn.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy/itxn.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy/op.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy/py.typed +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_compiled.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_context_helpers/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_context_helpers/context_storage.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_context_helpers/txn_context.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_itxn_loader.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_mutable.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_value_generators/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_value_generators/arc4.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_value_generators/txn.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/arc4.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/constants.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/context.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/decorators/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/decorators/arc4.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/decorators/subroutine.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/enums.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/gtxn.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/itxn.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/account.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/application.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/asset.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/logicsig.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/template_variable.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/txn_fields.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/unsigned_builtins.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/block.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/constants.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/crypto.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/global_values.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/itxn.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/misc.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/pure.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/txn.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/primitives/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/primitives/biguint.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/primitives/bytes.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/primitives/string.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/primitives/uint64.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/protocols.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/py.typed +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/state/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/state/box.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/state/global_state.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/state/local_state.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/state/utils.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/utilities/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/utilities/budget.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/utilities/log.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/src/algopy_testing/utils.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/templates/.macros.j2 +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/templates/.release_notes.md.j2 +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/templates/CHANGELOG.md.j2 +0 -0
- {algorand_python_testing-0.3.0b5/tests/arc4 → algorand_python_testing-0.3.0b6/tests}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5/tests/artifacts/Arc4ABIMethod → algorand_python_testing-0.3.0b6/tests/arc4}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/conftest.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/test_abi_call.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/test_address.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/test_arc4_method_signature.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/test_bool.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/test_dynamic_array.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/test_dynamic_bytes.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/test_emit.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/test_static_array.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/test_string.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/test_struct.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/test_tuple.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/test_ufixednxm.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/arc4/test_uintn.py +0 -0
- {algorand_python_testing-0.3.0b5/tests/artifacts/Arc4InnerTxns → algorand_python_testing-0.3.0b6/tests/artifacts/Arc4ABIMethod}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4ABIMethod/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5/tests/artifacts/Arc4PrimitiveOps → algorand_python_testing-0.3.0b6/tests/artifacts/Arc4InnerTxns}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4InnerTxns/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5/tests/artifacts/BoxContract → algorand_python_testing-0.3.0b6/tests/artifacts/Arc4PrimitiveOps}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4PrimitiveOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5/tests/artifacts/CryptoOps → algorand_python_testing-0.3.0b6/tests/artifacts/BoxContract}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/BoxContract/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/BoxContract/data/BoxContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/BoxContract/data/BoxContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/BoxContract/data/BoxContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5/tests/artifacts/GlobalStateValidator → algorand_python_testing-0.3.0b6/tests/artifacts/CryptoOps}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/CryptoOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/CryptoOps/data/CryptoOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/CryptoOps/data/CryptoOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/CryptoOps/data/CryptoOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5/tests/artifacts/MiscellaneousOps → algorand_python_testing-0.3.0b6/tests/artifacts/GlobalStateValidator}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/GlobalStateValidator/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5/tests/artifacts/PrimitiveOps → algorand_python_testing-0.3.0b6/tests/artifacts/MiscellaneousOps}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/MiscellaneousOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5/tests/artifacts/StateMutations → algorand_python_testing-0.3.0b6/tests/artifacts/PrimitiveOps}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/PrimitiveOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5/tests/artifacts/StateOps → algorand_python_testing-0.3.0b6/tests/artifacts/StateMutations}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateMutations/data/Contract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateMutations/data/Contract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateMutations/data/Contract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateMutations/statemutations.py +0 -0
- {algorand_python_testing-0.3.0b5/tests/artifacts → algorand_python_testing-0.3.0b6/tests/artifacts/StateOps}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/GlobalStateContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/GlobalStateContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/GlobalStateContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/ITxnOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/ITxnOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/ITxnOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/LocalStateContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/LocalStateContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/LocalStateContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAcctParamsGet.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAcctParamsGet.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAcctParamsGet.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppGlobalContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppGlobalContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppGlobalContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppGlobalExContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppGlobalExContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppGlobalExContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppLocalContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppLocalContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppLocalContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppLocalExContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppLocalExContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppLocalExContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppParamsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppParamsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppParamsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAssetHoldingContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAssetHoldingContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAssetHoldingContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAssetParamsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAssetParamsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAssetParamsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b5/tests/contexts → algorand_python_testing-0.3.0b6/tests/artifacts}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/conftest.py +0 -0
- {algorand_python_testing-0.3.0b5/tests/models → algorand_python_testing-0.3.0b6/tests/contexts}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5/tests/primitives → algorand_python_testing-0.3.0b6/tests/models}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/models/test_asset.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/models/test_box.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/models/test_box_map.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/models/test_box_ref.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/models/test_uenumerate.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/models/test_urange.py +0 -0
- {algorand_python_testing-0.3.0b5/tests/state → algorand_python_testing-0.3.0b6/tests/primitives}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/primitives/conftest.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/primitives/test_biguint.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/primitives/test_bytes.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/primitives/test_string.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/primitives/test_uint64.py +0 -0
- {algorand_python_testing-0.3.0b5/tests/utilities → algorand_python_testing-0.3.0b6/tests/state}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/state/conftest.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/state/test_global_state.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/state/test_local_state.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/test_context.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/test_miscellaneous_op.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/test_op.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/util.py +0 -0
- {algorand_python_testing-0.3.0b5/tests/value_generators → algorand_python_testing-0.3.0b6/tests/utilities}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/utilities/conftest.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/utilities/test_log.py +0 -0
- {algorand_python_testing-0.3.0b5 → algorand_python_testing-0.3.0b6}/tests/value_generators/test_avm.py +0 -0
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
|
+
## v0.3.0-beta.6 (2024-08-21)
|
|
3
|
+
|
|
4
|
+
### Documentation
|
|
5
|
+
|
|
6
|
+
* documentation for initial stable release of `algorand-python-testing` (#8) ([`9d97d0d`](https://github.com/algorandfoundation/algorand-python-testing/commit/9d97d0de5ff9897e642ec3f11a186f2fb95375bb))
|
|
7
|
+
|
|
8
|
+
* docs: wip
|
|
9
|
+
|
|
10
|
+
* chore: refresh pyproject
|
|
11
|
+
|
|
12
|
+
* docs: refining docs (wip)
|
|
13
|
+
|
|
14
|
+
* chore: integrating doctests
|
|
15
|
+
|
|
16
|
+
* docs: revamping docs with latest features
|
|
17
|
+
|
|
18
|
+
* docs: minor consistency with main readme; patching doctests
|
|
19
|
+
|
|
20
|
+
* docs: removing the box from examples
|
|
21
|
+
|
|
22
|
+
* docs: refine op codes section
|
|
23
|
+
|
|
24
|
+
* chore: merge conflicts
|
|
25
|
+
|
|
26
|
+
* chore: apply suggestions from code review
|
|
27
|
+
|
|
28
|
+
Co-authored-by: Daniel McGregor <daniel.mcgregor@makerx.com.au>
|
|
29
|
+
|
|
30
|
+
* docs: addressing docs pr comments
|
|
31
|
+
|
|
2
32
|
## v0.3.0-beta.5 (2024-08-21)
|
|
3
33
|
|
|
4
34
|
### Fix
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: algorand-python-testing
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.0b6
|
|
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
|
|
@@ -57,8 +57,15 @@ Alternatively, if you want to start from scratch:
|
|
|
57
57
|
from your_contract import YourContract
|
|
58
58
|
|
|
59
59
|
def test_your_contract():
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
# Arrange
|
|
61
|
+
contract = YourContract()
|
|
62
|
+
expected_result = ... # Your expected result here
|
|
63
|
+
|
|
64
|
+
# Act
|
|
65
|
+
result = contract.your_method() # Your test code here
|
|
66
|
+
|
|
67
|
+
# Assert
|
|
68
|
+
assert result == expected_result
|
|
62
69
|
```
|
|
63
70
|
|
|
64
71
|
5. Run your tests using your preferred Python testing framework (e.g., pytest, unittest)
|
|
@@ -34,8 +34,15 @@ Alternatively, if you want to start from scratch:
|
|
|
34
34
|
from your_contract import YourContract
|
|
35
35
|
|
|
36
36
|
def test_your_contract():
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
# Arrange
|
|
38
|
+
contract = YourContract()
|
|
39
|
+
expected_result = ... # Your expected result here
|
|
40
|
+
|
|
41
|
+
# Act
|
|
42
|
+
result = contract.your_method() # Your test code here
|
|
43
|
+
|
|
44
|
+
# Assert
|
|
45
|
+
assert result == expected_result
|
|
39
46
|
```
|
|
40
47
|
|
|
41
48
|
5. Run your tests using your preferred Python testing framework (e.g., pytest, unittest)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Algorand Python
|
|
2
|
+
|
|
3
|
+
Algorand Python is a partial implementation of the Python programming language that runs on the AVM. It includes a statically typed framework for development of Algorand smart contracts and logic signatures, with Pythonic interfaces to underlying AVM functionality that works with standard Python tooling.
|
|
4
|
+
|
|
5
|
+
Algorand Python is compiled for execution on the AVM by PuyaPy, an optimising compiler that ensures the resulting AVM bytecode execution semantics that match the given Python code. PuyaPy produces output that is directly compatible with [AlgoKit typed clients](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md#1-typed-clients) to make deployment and calling easy.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
To get started refer to the [official documentation](https://algorandfoundation.github.io/puya).
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# API Reference
|
|
2
|
+
|
|
3
|
+
```{autodoc2-summary}
|
|
4
|
+
:renderer: myst
|
|
5
|
+
|
|
6
|
+
algopy_testing.AlgopyTestContext
|
|
7
|
+
algopy_testing.LedgerContext
|
|
8
|
+
algopy_testing.TransactionContext
|
|
9
|
+
algopy_testing.AVMValueGenerator
|
|
10
|
+
algopy_testing.TxnValueGenerator
|
|
11
|
+
algopy_testing.ARC4ValueGenerator
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
> TODO: 1.0 Restructure algopy_testing index file once refactoring changes are merged
|
|
@@ -11,6 +11,7 @@ project = "Algorand Python Testing"
|
|
|
11
11
|
copyright = "2024, Algorand Foundation" # noqa: A001
|
|
12
12
|
author = "Algorand Foundation"
|
|
13
13
|
|
|
14
|
+
|
|
14
15
|
# -- General configuration ---------------------------------------------------
|
|
15
16
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
16
17
|
|
|
@@ -19,6 +20,9 @@ extensions = [
|
|
|
19
20
|
"sphinx.ext.intersphinx",
|
|
20
21
|
"sphinx_copybutton",
|
|
21
22
|
"myst_parser",
|
|
23
|
+
"autodoc2",
|
|
24
|
+
"sphinx.ext.doctest",
|
|
25
|
+
"sphinxmermaid",
|
|
22
26
|
]
|
|
23
27
|
|
|
24
28
|
templates_path = ["_templates"]
|
|
@@ -42,7 +46,6 @@ nitpick_ignore_regex = [
|
|
|
42
46
|
|
|
43
47
|
# -- Options for HTML output -------------------------------------------------
|
|
44
48
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
45
|
-
|
|
46
49
|
html_theme = "furo"
|
|
47
50
|
html_static_path = ["_static"]
|
|
48
51
|
html_css_files = [
|
|
@@ -52,7 +55,28 @@ html_css_files = [
|
|
|
52
55
|
python_maximum_signature_line_length = 80
|
|
53
56
|
|
|
54
57
|
# -- Options for myst ---
|
|
55
|
-
myst_enable_extensions = [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
myst_enable_extensions = ["colon_fence", "fieldlist"]
|
|
59
|
+
|
|
60
|
+
# -- Options for autodoc2
|
|
61
|
+
autodoc2_packages = [
|
|
62
|
+
{
|
|
63
|
+
"path": "../src/algopy_testing",
|
|
64
|
+
"auto_mode": False,
|
|
65
|
+
},
|
|
66
|
+
]
|
|
67
|
+
autodoc2_render_plugin = "myst"
|
|
68
|
+
autodoc2_hidden_objects = [
|
|
69
|
+
"dunder",
|
|
70
|
+
"private",
|
|
71
|
+
"undoc",
|
|
58
72
|
]
|
|
73
|
+
add_module_names = False
|
|
74
|
+
autodoc2_index_template = None
|
|
75
|
+
|
|
76
|
+
# -- Options for doctest --
|
|
77
|
+
doctest_test_doctest_blocks = "default"
|
|
78
|
+
|
|
79
|
+
# -- Options for mermaid --
|
|
80
|
+
sphinxmermaid_mermaid_init = {
|
|
81
|
+
"theme": "dark",
|
|
82
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Coverage
|
|
2
|
+
|
|
3
|
+
See which `algorand-python` stubs are implemented by the `algorand-python-testing` library. See the [Concepts](testing-guide/concepts.md#types-of-algopy-stub-implementations) section for more details on the implementation categories.
|
|
4
|
+
|
|
5
|
+
Based on the definitions provided and the implementation details in the `src` directory, here is the classification for the abstractions outlined in the table under the `Name` column:
|
|
6
|
+
|
|
7
|
+
| Name | Implementation type |
|
|
8
|
+
| ------------------------------------------- | ------------------- |
|
|
9
|
+
| algopy.Account | Emulated |
|
|
10
|
+
| algopy.Application | Emulated |
|
|
11
|
+
| algopy.Asset | Emulated |
|
|
12
|
+
| algopy.BigUInt | Native |
|
|
13
|
+
| algopy.Box | Emulated |
|
|
14
|
+
| algopy.BoxMap | Emulated |
|
|
15
|
+
| algopy.BoxRef | Emulated |
|
|
16
|
+
| algopy.Bytes | Native |
|
|
17
|
+
| algopy.BytesBacked | Native |
|
|
18
|
+
| algopy.CompiledContract | Mockable |
|
|
19
|
+
| algopy.CompiledLogicSig | Mockable |
|
|
20
|
+
| algopy.Contract | Emulated |
|
|
21
|
+
| algopy.Global | Emulated |
|
|
22
|
+
| algopy.GlobalState | Emulated |
|
|
23
|
+
| algopy.LocalState | Emulated |
|
|
24
|
+
| algopy.LogicSig | Emulated |
|
|
25
|
+
| algopy.OnCompleteAction | Native |
|
|
26
|
+
| algopy.OpUpFeeSource | Native |
|
|
27
|
+
| algopy.StateTotals | Emulated |
|
|
28
|
+
| algopy.String | Native |
|
|
29
|
+
| algopy.TemplateVar | Emulated |
|
|
30
|
+
| algopy.TransactionType | Native |
|
|
31
|
+
| algopy.Txn | Emulated |
|
|
32
|
+
| algopy.UInt64 | Native |
|
|
33
|
+
| algopy.compile_contract | Mockable |
|
|
34
|
+
| algopy.compile_logicsig | Mockable |
|
|
35
|
+
| algopy.ensure_budget | Emulated |
|
|
36
|
+
| algopy.log | Emulated |
|
|
37
|
+
| algopy.logicsig | Emulated |
|
|
38
|
+
| algopy.subroutine | Native |
|
|
39
|
+
| algopy.uenumerate | Native |
|
|
40
|
+
| algopy.urange | Native |
|
|
41
|
+
| algopy.arc4.ARC4Client | Emulated |
|
|
42
|
+
| algopy.arc4.ARC4Contract | Emulated |
|
|
43
|
+
| algopy.arc4.Address | Native |
|
|
44
|
+
| algopy.arc4.BigUFixedNxM | Native |
|
|
45
|
+
| algopy.arc4.BigUIntN | Native |
|
|
46
|
+
| algopy.arc4.Bool | Native |
|
|
47
|
+
| algopy.arc4.Byte | Native |
|
|
48
|
+
| algopy.arc4.DynamicArray | Native |
|
|
49
|
+
| algopy.arc4.DynamicBytes | Native |
|
|
50
|
+
| algopy.arc4.StaticArray | Native |
|
|
51
|
+
| algopy.arc4.String | Native |
|
|
52
|
+
| algopy.arc4.Struct | Native |
|
|
53
|
+
| algopy.arc4.Tuple | Native |
|
|
54
|
+
| algopy.arc4.UFixedNxM | Native |
|
|
55
|
+
| algopy.arc4.UInt128 | Native |
|
|
56
|
+
| algopy.arc4.UInt16 | Native |
|
|
57
|
+
| algopy.arc4.UInt256 | Native |
|
|
58
|
+
| algopy.arc4.UInt32 | Native |
|
|
59
|
+
| algopy.arc4.UInt512 | Native |
|
|
60
|
+
| algopy.arc4.UInt64 | Native |
|
|
61
|
+
| algopy.arc4.UInt8 | Native |
|
|
62
|
+
| algopy.arc4.UIntN | Native |
|
|
63
|
+
| algopy.arc4.abimethod | Emulated |
|
|
64
|
+
| algopy.arc4.arc4_signature | Native |
|
|
65
|
+
| algopy.arc4.baremethod | Emulated |
|
|
66
|
+
| algopy.arc4.emit | Emulated |
|
|
67
|
+
| algopy.arc4.abi_call | Mockable |
|
|
68
|
+
| algopy.arc4.arc4_create | Mockable |
|
|
69
|
+
| algopy.arc4.arc4_update | Mockable |
|
|
70
|
+
| algopy.gtxn.ApplicationCallTransaction | Emulated |
|
|
71
|
+
| algopy.gtxn.AssetConfigTransaction | Emulated |
|
|
72
|
+
| algopy.gtxn.AssetFreezeTransaction | Emulated |
|
|
73
|
+
| algopy.gtxn.AssetTransferTransaction | Emulated |
|
|
74
|
+
| algopy.gtxn.KeyRegistrationTransaction | Emulated |
|
|
75
|
+
| algopy.gtxn.PaymentTransaction | Emulated |
|
|
76
|
+
| algopy.gtxn.Transaction | Emulated |
|
|
77
|
+
| algopy.gtxn.TransactionBase | Emulated |
|
|
78
|
+
| algopy.itxn.ApplicationCall | Emulated |
|
|
79
|
+
| algopy.itxn.ApplicationCallInnerTransaction | Emulated |
|
|
80
|
+
| algopy.itxn.AssetConfig | Emulated |
|
|
81
|
+
| algopy.itxn.AssetConfigInnerTransaction | Emulated |
|
|
82
|
+
| algopy.itxn.AssetFreeze | Emulated |
|
|
83
|
+
| algopy.itxn.AssetFreezeInnerTransaction | Emulated |
|
|
84
|
+
| algopy.itxn.AssetTransfer | Emulated |
|
|
85
|
+
| algopy.itxn.AssetTransferInnerTransaction | Emulated |
|
|
86
|
+
| algopy.itxn.InnerTransaction | Emulated |
|
|
87
|
+
| algopy.itxn.InnerTransactionResult | Emulated |
|
|
88
|
+
| algopy.itxn.KeyRegistration | Emulated |
|
|
89
|
+
| algopy.itxn.KeyRegistrationInnerTransaction | Emulated |
|
|
90
|
+
| algopy.itxn.Payment | Emulated |
|
|
91
|
+
| algopy.itxn.PaymentInnerTransaction | Emulated |
|
|
92
|
+
| algopy.itxn.submit_txns | Emulated |
|
|
93
|
+
| algopy.op.Base64 | Native |
|
|
94
|
+
| algopy.op.EC | Native |
|
|
95
|
+
| algopy.op.ECDSA | Native |
|
|
96
|
+
| algopy.op.JsonRef | Native |
|
|
97
|
+
| algopy.op.addw | Native |
|
|
98
|
+
| algopy.op.arg | Emulated |
|
|
99
|
+
| algopy.op.base64_decode | Native |
|
|
100
|
+
| algopy.op.bitlen | Native |
|
|
101
|
+
| algopy.op.bsqrt | Native |
|
|
102
|
+
| algopy.op.btoi | Native |
|
|
103
|
+
| algopy.op.bzero | Native |
|
|
104
|
+
| algopy.op.concat | Native |
|
|
105
|
+
| algopy.op.divmodw | Native |
|
|
106
|
+
| algopy.op.divw | Native |
|
|
107
|
+
| algopy.op.ecdsa_pk_decompress | Native |
|
|
108
|
+
| algopy.op.ecdsa_pk_recover | Native |
|
|
109
|
+
| algopy.op.ecdsa_verify | Native |
|
|
110
|
+
| algopy.op.ed25519verify | Native |
|
|
111
|
+
| algopy.op.ed25519verify_bare | Native |
|
|
112
|
+
| algopy.op.err | Native |
|
|
113
|
+
| algopy.op.exit | Native |
|
|
114
|
+
| algopy.op.exp | Native |
|
|
115
|
+
| algopy.op.expw | Native |
|
|
116
|
+
| algopy.op.extract | Native |
|
|
117
|
+
| algopy.op.extract_uint16 | Native |
|
|
118
|
+
| algopy.op.extract_uint32 | Native |
|
|
119
|
+
| algopy.op.extract_uint64 | Native |
|
|
120
|
+
| algopy.op.getbit | Native |
|
|
121
|
+
| algopy.op.getbyte | Native |
|
|
122
|
+
| algopy.op.itob | Native |
|
|
123
|
+
| algopy.op.keccak256 | Native |
|
|
124
|
+
| algopy.op.mulw | Native |
|
|
125
|
+
| algopy.op.replace | Native |
|
|
126
|
+
| algopy.op.select_bytes | Native |
|
|
127
|
+
| algopy.op.select_uint64 | Native |
|
|
128
|
+
| algopy.op.setbit_bytes | Native |
|
|
129
|
+
| algopy.op.setbit_uint64 | Native |
|
|
130
|
+
| algopy.op.setbyte | Native |
|
|
131
|
+
| algopy.op.sha256 | Native |
|
|
132
|
+
| algopy.op.sha3_256 | Native |
|
|
133
|
+
| algopy.op.sha512_256 | Native |
|
|
134
|
+
| algopy.op.shl | Native |
|
|
135
|
+
| algopy.op.shr | Native |
|
|
136
|
+
| algopy.op.sqrt | Native |
|
|
137
|
+
| algopy.op.substring | Native |
|
|
138
|
+
| algopy.op.AppGlobal | Emulated |
|
|
139
|
+
| algopy.op.AppLocal | Emulated |
|
|
140
|
+
| algopy.op.AppParamsGet | Emulated |
|
|
141
|
+
| algopy.op.AssetHoldingGet | Emulated |
|
|
142
|
+
| algopy.op.AssetParamsGet | Emulated |
|
|
143
|
+
| algopy.op.Block | Emulated |
|
|
144
|
+
| algopy.op.Box | Emulated |
|
|
145
|
+
| algopy.op.GITxn | Emulated |
|
|
146
|
+
| algopy.op.GTxn | Emulated |
|
|
147
|
+
| algopy.op.Global | Emulated |
|
|
148
|
+
| algopy.op.ITxn | Emulated |
|
|
149
|
+
| algopy.op.ITxnCreate | Emulated |
|
|
150
|
+
| algopy.op.Scratch | Emulated |
|
|
151
|
+
| algopy.op.Txn | Emulated |
|
|
152
|
+
| algopy.op.app_opted_in | Emulated |
|
|
153
|
+
| algopy.op.balance | Emulated |
|
|
154
|
+
| algopy.op.gaid | Emulated |
|
|
155
|
+
| algopy.op.gload_bytes | Emulated |
|
|
156
|
+
| algopy.op.gload_uint64 | Emulated |
|
|
157
|
+
| algopy.op.min_balance | Emulated |
|
|
158
|
+
| algopy.op.AcctParamsGet | Emulated |
|
|
159
|
+
| algopy.op.EllipticCurve | Mockable |
|
|
160
|
+
| algopy.op.VrfVerify | Mockable |
|
|
161
|
+
| algopy.op.vrf_verify | Mockable |
|
|
162
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Examples
|
|
2
|
+
|
|
3
|
+
Below is a showcase of various examples of unit testing real and sample Algorand Python smart contracts using `algorand-python-testing`.
|
|
4
|
+
|
|
5
|
+
| Contract Name | Test File | Key Features Demonstrated | Test versions of Algopy Abstractions used |
|
|
6
|
+
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
7
|
+
| Auction | [test_contract.py](https://github.com/algorandfoundation/algorand-python-testing/blob/main/examples/auction/test_contract.py) | - Use of algopy_testing_context<br>- Mocking of global state and transaction fields<br>- Testing of ARC4 contract methods<br>- Emulation of asset creation and transfers<br>- Verification of inner transactions | - **ARC4Contract**<br>- **Global**<br>- **Txn**<br>- **Asset**<br>- **Account**<br>- **LocalState** |
|
|
8
|
+
| Proof of Attendance | [test_contract.py](https://github.com/algorandfoundation/algorand-python-testing/blob/main/examples/proof_of_attendance/test_contract.py) | - Creation and management of dummy assets<br>- Testing of box storage operations<br>- Verification of inner transactions for asset transfers<br>- Use of any\_\* methods for generating test data | - **ARC4Contract**<br>- **Box**<br>- **BoxMap**<br>- **Asset**<br>- **Account**<br>- **op** |
|
|
9
|
+
| Simple Voting | [test_contract.py](https://github.com/algorandfoundation/algorand-python-testing/blob/main/examples/simple_voting/test_contract.py) | - Testing of global and local state operations<br>- Verification of transaction group operations<br>- Mocking of payment transactions | - **Contract**<br>- **GlobalState**<br>- **LocalState**<br>- **Txn**<br>- **op.GTxn** |
|
|
10
|
+
| ZK Whitelist | [test_contract.py](https://github.com/algorandfoundation/algorand-python-testing/blob/main/examples/zk_whitelist/test_contract.py) | - Testing of zero-knowledge proof verification<br>- Mocking of external application calls<br>- Use of ARC4 types and methods | - **ARC4Contract**<br>- **arc4 types**<br>- **LocalState**<br>- **Global**<br>- **Txn** |
|
|
11
|
+
| HTLC LogicSig | [test_signature.py](https://github.com/algorandfoundation/algorand-python-testing/blob/main/examples/htlc_logicsig/test_signature.py) | - Testing of LogicSig contracts<br>- Verification of time-based conditions<br>- Mocking of transaction parameters | - **logicsig**<br>- **Account**<br>- **Txn**<br>- **Global**<br>- **op** |
|
|
12
|
+
| Marketplace | [test_contract.py](https://github.com/algorandfoundation/algorand-python-testing/blob/main/examples/marketplace/test_contract.py) | - Testing of complex marketplace operations<br>- Use of BoxMap for listings<br>- Testing of asset transfers and payments | - **ARC4Contract**<br>- **BoxMap**<br>- **Asset**<br>- **arc4 types**<br>- **Global**<br>- **Txn** |
|
|
13
|
+
| Scratch Storage | [test_contract.py](https://github.com/algorandfoundation/algorand-python-testing/blob/main/examples/scratch_storage/test_contract.py) | - Testing of scratch space usage<br>- Verification of scratch slot values | - **ARC4Contract**<br>- **Contract**<br>- **op** |
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Glossary
|
|
2
|
+
|
|
3
|
+
| Term | Definition |
|
|
4
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
5
|
+
| [**Test Context**](testing-guide/concepts.md#test-context) | A context manager that provides a simulated Algorand environment for testing Python smart contracts. |
|
|
6
|
+
| [**Algorand Virtual Machine (AVM)**](https://developer.algorand.org/docs/get-details/dapps/avm/) | The AVM is the runtime environment for Algorand smart contracts. |
|
|
7
|
+
| [**Operational codes**](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/?from_query=OPcodes#template-modal-overlay) | AVM instructions that are executed directly by the AVM, provided by `algopy` stubs and emulated/implemented or mocked by `algorand-python-testing`. |
|
|
8
|
+
| [**Value generators**](testing-guide/concepts.md#value-generators) | Helper methods that generate randomized values for testing when the value of the tested type is not needed. Represented by instance methods on the context manager, prefixed with `any_*` (or `arc.any_*` in case of ARC 4 types). |
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Algorand Python Testing
|
|
2
|
+
|
|
3
|
+
[](https://github.com/algorandfoundation/algorand-python-testing/)
|
|
4
|
+
[](https://developer.algorand.org/algokit/)
|
|
5
|
+
[](https://github.com/algorandfoundation/algorand-python-testing)
|
|
6
|
+
[](https://developer.algorand.org/algokit/)
|
|
7
|
+
|
|
8
|
+
`algorand-python-testing` is a companion package to [Algorand Python](https://github.com/algorandfoundation/puya) that enables efficient unit testing of Algorand Python smart contracts in an offline environment. This package emulates key AVM behaviors without requiring a network connection, offering fast and reliable testing capabilities with a familiar Pythonic interface.
|
|
9
|
+
|
|
10
|
+
The `algorand-python-testing` package provides:
|
|
11
|
+
|
|
12
|
+
- A simple interface for fast and reliable unit testing
|
|
13
|
+
- An offline testing environment that simulates core AVM functionality
|
|
14
|
+
- A familiar Pythonic experience, compatible with testing frameworks like [pytest](https://docs.pytest.org/en/latest/), [unittest](https://docs.python.org/3/library/unittest.html), and [hypothesis](https://hypothesis.readthedocs.io/en/latest/)
|
|
15
|
+
|
|
16
|
+
```{testsetup}
|
|
17
|
+
import algopy
|
|
18
|
+
import algopy_testing
|
|
19
|
+
from algopy_testing import algopy_testing_context
|
|
20
|
+
|
|
21
|
+
# Create the context manager for snippets below
|
|
22
|
+
ctx_manager = algopy_testing_context()
|
|
23
|
+
|
|
24
|
+
# Enter the context
|
|
25
|
+
context = ctx_manager.__enter__()
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
`algopy` is a prerequisite for `algorand-python-testing`, providing stubs and type annotations for Algorand Python syntax. It enhances code completion and type checking when writing smart contracts. Note that this code isn't directly executable in standard Python interpreters; it's compiled by `puya` into TEAL for Algorand Network deployment.
|
|
31
|
+
|
|
32
|
+
Traditionally, testing Algorand smart contracts involved deployment on sandboxed networks and interacting with live instances. While robust, this approach can be inefficient and lacks versatility for testing Algorand Python code.
|
|
33
|
+
|
|
34
|
+
Enter `algorand-python-testing`: it leverages Python's rich testing ecosystem for unit testing without network deployment. This enables rapid iteration and granular logic testing.
|
|
35
|
+
|
|
36
|
+
> **NOTE**: While `algorand-python-testing` offers valuable unit testing capabilities, it's not a replacement for comprehensive testing. Use it alongside other test types, particularly those running against the actual Algorand Network, for thorough contract validation.
|
|
37
|
+
|
|
38
|
+
### Prerequisites
|
|
39
|
+
|
|
40
|
+
- Python 3.12 or later
|
|
41
|
+
- [Algorand Python](https://github.com/algorandfoundation/puya)
|
|
42
|
+
|
|
43
|
+
### Installation
|
|
44
|
+
|
|
45
|
+
`algorand-python-testing` is distributed via [PyPI](https://pypi.org/project/algorand-python-testing/). Install the package using `pip`:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install algorand-python-testing
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
or using `poetry`:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
poetry add algorand-python-testing
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Testing your first contract
|
|
58
|
+
|
|
59
|
+
Let's write a simple contract and test it using the `algorand-python-testing` framework.
|
|
60
|
+
|
|
61
|
+
#### Contract Definition
|
|
62
|
+
|
|
63
|
+
```{testcode}
|
|
64
|
+
import algopy
|
|
65
|
+
from algopy import arc4
|
|
66
|
+
|
|
67
|
+
class VotingContract(algopy.ARC4Contract):
|
|
68
|
+
def __init__(self) -> None:
|
|
69
|
+
self.topic = algopy.GlobalState(algopy.Bytes(b"default_topic"), key="topic", description="Voting topic")
|
|
70
|
+
self.votes = algopy.GlobalState(
|
|
71
|
+
algopy.UInt64(0),
|
|
72
|
+
key="votes",
|
|
73
|
+
description="Votes for the option",
|
|
74
|
+
)
|
|
75
|
+
self.voted = algopy.LocalState(algopy.UInt64, key="voted", description="Tracks if an account has voted")
|
|
76
|
+
|
|
77
|
+
@arc4.abimethod
|
|
78
|
+
def set_topic(self, topic: arc4.String) -> None:
|
|
79
|
+
self.topic.value = topic.bytes
|
|
80
|
+
|
|
81
|
+
@arc4.abimethod
|
|
82
|
+
def vote(self, pay: algopy.gtxn.PaymentTransaction) -> arc4.Bool:
|
|
83
|
+
assert algopy.op.Global.group_size == algopy.UInt64(2), "Expected 2 transactions"
|
|
84
|
+
assert pay.amount == algopy.UInt64(10_000), "Incorrect payment amount"
|
|
85
|
+
assert pay.sender == algopy.Txn.sender, "Payment sender must match transaction sender"
|
|
86
|
+
|
|
87
|
+
_value, exists = self.voted.maybe(algopy.Txn.sender)
|
|
88
|
+
if exists:
|
|
89
|
+
return arc4.Bool(False) # Already voted
|
|
90
|
+
self.votes.value += algopy.UInt64(1)
|
|
91
|
+
self.voted[algopy.Txn.sender] = algopy.UInt64(1)
|
|
92
|
+
return arc4.Bool(True)
|
|
93
|
+
|
|
94
|
+
@arc4.abimethod(readonly=True)
|
|
95
|
+
def get_votes(self) -> arc4.UInt64:
|
|
96
|
+
return arc4.UInt64(self.votes.value)
|
|
97
|
+
|
|
98
|
+
def clear_state_program(self) -> bool:
|
|
99
|
+
return True
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### Test Definition
|
|
103
|
+
|
|
104
|
+
```{testcode}
|
|
105
|
+
from collections.abc import Generator
|
|
106
|
+
import pytest
|
|
107
|
+
from algopy_testing import AlgopyTestContext, algopy_testing_context
|
|
108
|
+
from algopy import arc4
|
|
109
|
+
|
|
110
|
+
# Create a test context
|
|
111
|
+
with algopy_testing_context() as context:
|
|
112
|
+
|
|
113
|
+
# Initialize the contract
|
|
114
|
+
contract = VotingContract()
|
|
115
|
+
|
|
116
|
+
# Test vote function
|
|
117
|
+
voter = context.default_sender
|
|
118
|
+
payment = context.any.txn.payment(
|
|
119
|
+
sender=voter,
|
|
120
|
+
amount=algopy.UInt64(10_000),
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
result = contract.vote(payment)
|
|
124
|
+
print(f"Vote result: {result.native}")
|
|
125
|
+
print(f"Total votes: {contract.votes.value}")
|
|
126
|
+
print(f"Voter {voter} voted: {contract.voted[voter]}")
|
|
127
|
+
|
|
128
|
+
# Test set_topic function
|
|
129
|
+
new_topic = context.any.arc4.string(10)
|
|
130
|
+
contract.set_topic(new_topic)
|
|
131
|
+
print(f"New topic: {new_topic.native}")
|
|
132
|
+
print(f"Contract topic: {contract.topic.value}")
|
|
133
|
+
|
|
134
|
+
# Test get_votes function
|
|
135
|
+
contract.votes.value = algopy.UInt64(5)
|
|
136
|
+
votes = contract.get_votes()
|
|
137
|
+
print(f"Current votes: {votes.native}")
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```{testoutput}
|
|
141
|
+
:hide:
|
|
142
|
+
|
|
143
|
+
Vote result: True
|
|
144
|
+
Total votes: 1
|
|
145
|
+
Voter ... voted: 1
|
|
146
|
+
New topic: ...
|
|
147
|
+
Contract topic: ...
|
|
148
|
+
Current votes: 5
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
This example demonstrates key aspects of testing with `algorand-python-testing` for ARC4-based contracts:
|
|
152
|
+
|
|
153
|
+
1. ARC4 Contract Features:
|
|
154
|
+
|
|
155
|
+
- Use of `algopy.ARC4Contract` as the base class for the contract.
|
|
156
|
+
- ABI methods defined using the `@arc4.abimethod` decorator.
|
|
157
|
+
- Use of ARC4-specific types like `arc4.String`, `arc4.Bool`, and `arc4.UInt64`.
|
|
158
|
+
- Readonly method annotation with `@arc4.abimethod(readonly=True)`.
|
|
159
|
+
|
|
160
|
+
2. Testing ARC4 Contracts:
|
|
161
|
+
|
|
162
|
+
- Creation of an `ARC4Contract` instance within the test context.
|
|
163
|
+
- Use of `context.any.arc4` for generating ARC4-specific random test data.
|
|
164
|
+
- Direct invocation of ABI methods on the contract instance.
|
|
165
|
+
|
|
166
|
+
3. Transaction Handling:
|
|
167
|
+
|
|
168
|
+
- Use of `context.any.txn` to create test transactions.
|
|
169
|
+
- Passing transaction objects as parameters to contract methods.
|
|
170
|
+
|
|
171
|
+
4. State Verification:
|
|
172
|
+
- Checking global and local state changes after method execution.
|
|
173
|
+
- Verifying return values from ABI methods using ARC4-specific types.
|
|
174
|
+
|
|
175
|
+
> **NOTE**: Thorough testing is crucial in smart contract development due to their immutable nature post-deployment. Comprehensive unit and integration tests ensure contract validity and reliability. Optimizing for efficiency can significantly improve user experience by reducing transaction fees and simplifying interactions. Investing in robust testing and optimization practices is crucial and offers many benefits in the long run.
|
|
176
|
+
|
|
177
|
+
### Next steps
|
|
178
|
+
|
|
179
|
+
To dig deeper into the capabilities of `algorand-python-testing`, continue with the following sections.
|
|
180
|
+
|
|
181
|
+
```{toctree}
|
|
182
|
+
---
|
|
183
|
+
maxdepth: 2
|
|
184
|
+
caption: Contents
|
|
185
|
+
hidden: true
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
testing-guide/index
|
|
189
|
+
examples
|
|
190
|
+
coverage
|
|
191
|
+
glossary
|
|
192
|
+
api
|
|
193
|
+
algopy
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
```{testcleanup}
|
|
197
|
+
ctx_manager.__exit__(None, None, None)
|
|
198
|
+
```
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# ARC4 Types
|
|
2
|
+
|
|
3
|
+
These types are available under the `algopy.arc4` namespace. Refer to the [ARC4 specification](https://arc.algorand.foundation/ARCs/arc-0004) for more details on the spec.
|
|
4
|
+
|
|
5
|
+
```{hint}
|
|
6
|
+
Test context manager provides _value generators_ for ARC4 types. To access their _value generators_, use `{context_instance}.any.arc4` property. See more examples below.
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```{note}
|
|
10
|
+
For all `algopy.arc4` types with and without respective _value generator_, instantiation can be performed directly. If you have a suggestion for a new _value generator_ implementation, please open an issue in the [`algorand-python-testing`](https://github.com/algorandfoundation/algorand-python-testing) repository or contribute by following the [contribution guide](https://github.com/algorandfoundation/algorand-python-testing/blob/main/CONTRIBUTING.md).
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```{testsetup}
|
|
14
|
+
import algopy
|
|
15
|
+
import algopy_testing
|
|
16
|
+
from algopy_testing import algopy_testing_context
|
|
17
|
+
|
|
18
|
+
# Create the context manager for snippets below
|
|
19
|
+
ctx_manager = algopy_testing_context()
|
|
20
|
+
|
|
21
|
+
# Enter the context
|
|
22
|
+
context = ctx_manager.__enter__()
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Unsigned Integers
|
|
26
|
+
|
|
27
|
+
```{testcode}
|
|
28
|
+
from algopy import arc4
|
|
29
|
+
|
|
30
|
+
# Integer types
|
|
31
|
+
uint8_value = arc4.UInt8(255)
|
|
32
|
+
uint16_value = arc4.UInt16(65535)
|
|
33
|
+
uint32_value = arc4.UInt32(4294967295)
|
|
34
|
+
uint64_value = arc4.UInt64(18446744073709551615)
|
|
35
|
+
|
|
36
|
+
... # instantiate test context
|
|
37
|
+
# Generate a random unsigned arc4 integer with default range
|
|
38
|
+
uint8 = context.any.arc4.uint8()
|
|
39
|
+
uint16 = context.any.arc4.uint16()
|
|
40
|
+
uint32 = context.any.arc4.uint32()
|
|
41
|
+
uint64 = context.any.arc4.uint64()
|
|
42
|
+
biguint128 = context.any.arc4.biguint128()
|
|
43
|
+
biguint256 = context.any.arc4.biguint256()
|
|
44
|
+
biguint512 = context.any.arc4.biguint512()
|
|
45
|
+
|
|
46
|
+
# Generate a random unsigned arc4 integer with specified range
|
|
47
|
+
uint8_custom = context.any.arc4.uint8(min_value=10, max_value=100)
|
|
48
|
+
uint16_custom = context.any.arc4.uint16(min_value=1000, max_value=5000)
|
|
49
|
+
uint32_custom = context.any.arc4.uint32(min_value=100000, max_value=1000000)
|
|
50
|
+
uint64_custom = context.any.arc4.uint64(min_value=1000000000, max_value=10000000000)
|
|
51
|
+
biguint128_custom = context.any.arc4.biguint128(min_value=1000000000000000, max_value=10000000000000000)
|
|
52
|
+
biguint256_custom = context.any.arc4.biguint256(min_value=1000000000000000000000000, max_value=10000000000000000000000000)
|
|
53
|
+
biguint512_custom = context.any.arc4.biguint512(min_value=10000000000000000000000000000000000, max_value=10000000000000000000000000000000000)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Address
|
|
57
|
+
|
|
58
|
+
```{testcode}
|
|
59
|
+
from algopy import arc4
|
|
60
|
+
|
|
61
|
+
# Address type
|
|
62
|
+
address_value = arc4.Address("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ")
|
|
63
|
+
|
|
64
|
+
# Generate a random address
|
|
65
|
+
random_address = context.any.arc4.address()
|
|
66
|
+
|
|
67
|
+
# Access native underlaying type
|
|
68
|
+
native = random_address.native
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Dynamic Bytes
|
|
72
|
+
|
|
73
|
+
```{testcode}
|
|
74
|
+
from algopy import arc4
|
|
75
|
+
|
|
76
|
+
# Dynamic byte string
|
|
77
|
+
bytes_value = arc4.DynamicBytes(b"Hello, Algorand!")
|
|
78
|
+
|
|
79
|
+
# Generate random dynamic bytes
|
|
80
|
+
random_dynamic_bytes = context.any.arc4.dynamic_bytes(n=123) # n is the number of bits in the arc4 dynamic bytes
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## String
|
|
84
|
+
|
|
85
|
+
```{testcode}
|
|
86
|
+
from algopy import arc4
|
|
87
|
+
|
|
88
|
+
# UTF-8 encoded string
|
|
89
|
+
string_value = arc4.String("Hello, Algorand!")
|
|
90
|
+
|
|
91
|
+
# Generate random string
|
|
92
|
+
random_string = context.any.arc4.string(n=12) # n is the number of bits in the arc4 string
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```{testcleanup}
|
|
96
|
+
ctx_manager.__exit__(None, None, None)
|
|
97
|
+
```
|