algorand-python-testing 0.3.0b4__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.
Files changed (265) hide show
  1. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/CHANGELOG.md +48 -0
  2. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/PKG-INFO +10 -3
  3. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/README.md +9 -2
  4. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/docs/_static/custom.css +2 -1
  5. algorand_python_testing-0.3.0b6/docs/algopy.md +9 -0
  6. algorand_python_testing-0.3.0b6/docs/api.md +14 -0
  7. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/docs/conf.py +28 -4
  8. algorand_python_testing-0.3.0b6/docs/coverage.md +162 -0
  9. algorand_python_testing-0.3.0b6/docs/examples.md +13 -0
  10. algorand_python_testing-0.3.0b6/docs/glossary.md +8 -0
  11. algorand_python_testing-0.3.0b6/docs/index.md +198 -0
  12. algorand_python_testing-0.3.0b6/docs/testing-guide/arc4-types.md +97 -0
  13. algorand_python_testing-0.3.0b6/docs/testing-guide/avm-types.md +225 -0
  14. algorand_python_testing-0.3.0b6/docs/testing-guide/concepts.md +58 -0
  15. algorand_python_testing-0.3.0b6/docs/testing-guide/contract-testing.md +225 -0
  16. algorand_python_testing-0.3.0b6/docs/testing-guide/index.md +67 -0
  17. algorand_python_testing-0.3.0b6/docs/testing-guide/opcodes.md +387 -0
  18. algorand_python_testing-0.3.0b6/docs/testing-guide/signature-testing.md +74 -0
  19. algorand_python_testing-0.3.0b6/docs/testing-guide/state-management.md +105 -0
  20. algorand_python_testing-0.3.0b6/docs/testing-guide/subroutines.md +62 -0
  21. algorand_python_testing-0.3.0b6/docs/testing-guide/transactions.md +200 -0
  22. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/auction/test_contract.py +2 -2
  23. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/marketplace/test_contract.py +3 -3
  24. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/scratch_storage/test_contract.py +1 -1
  25. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/simple_voting/test_contract.py +1 -1
  26. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/zk_whitelist/test_contract.py +2 -2
  27. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/pyproject.toml +22 -3
  28. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/__init__.py +9 -1
  29. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_context_helpers/ledger_context.py +8 -6
  30. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_context_helpers/txn_context.py +1 -0
  31. algorand_python_testing-0.3.0b6/src/algopy_testing/_mutable.py +65 -0
  32. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_value_generators/avm.py +18 -1
  33. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/arc4.py +242 -134
  34. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/context.py +0 -11
  35. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/decorators/arc4.py +23 -3
  36. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/enums.py +16 -0
  37. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/contract.py +4 -1
  38. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/primitives/uint64.py +0 -3
  39. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/state/box.py +6 -26
  40. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/state/global_state.py +12 -7
  41. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/state/local_state.py +4 -1
  42. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/utils.py +0 -2
  43. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/test_arc4_method_signature.py +1 -1
  44. algorand_python_testing-0.3.0b6/tests/artifacts/StateMutations/data/Contract.approval.teal +831 -0
  45. algorand_python_testing-0.3.0b6/tests/artifacts/StateMutations/data/Contract.arc32.json +87 -0
  46. algorand_python_testing-0.3.0b6/tests/artifacts/StateMutations/data/Contract.clear.teal +7 -0
  47. algorand_python_testing-0.3.0b6/tests/artifacts/StateMutations/statemutations.py +88 -0
  48. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/common.py +3 -3
  49. algorand_python_testing-0.3.0b6/tests/state/test_mutations.py +56 -0
  50. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/test_context.py +1 -1
  51. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/test_op.py +6 -6
  52. algorand_python_testing-0.3.0b6/tests/utilities/__init__.py +0 -0
  53. algorand_python_testing-0.3.0b6/tests/value_generators/__init__.py +0 -0
  54. algorand_python_testing-0.3.0b4/docs/coverage.md +0 -43
  55. algorand_python_testing-0.3.0b4/docs/examples.md +0 -11
  56. algorand_python_testing-0.3.0b4/docs/index.md +0 -117
  57. algorand_python_testing-0.3.0b4/docs/usage.md +0 -292
  58. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/.coveragerc +0 -0
  59. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/.editorconfig +0 -0
  60. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  61. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  62. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/.github/pull_request_template.md +0 -0
  63. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/.github/workflows/cd.yaml +0 -0
  64. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/.github/workflows/ci.yaml +0 -0
  65. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/.github/workflows/gh-pages.yaml +0 -0
  66. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/.gitignore +0 -0
  67. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/.pre-commit-config.yaml +0 -0
  68. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/.vscode/extensions.json +0 -0
  69. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/.vscode/launch.json +0 -0
  70. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/.vscode/settings.json +0 -0
  71. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/CONTRIBUTING.md +0 -0
  72. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/LICENSE +0 -0
  73. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/docs/Makefile +0 -0
  74. {algorand_python_testing-0.3.0b4/examples → algorand_python_testing-0.3.0b6/docs}/__init__.py +0 -0
  75. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/docs/make.bat +0 -0
  76. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/README.md +0 -0
  77. {algorand_python_testing-0.3.0b4/examples/auction → algorand_python_testing-0.3.0b6/examples}/__init__.py +0 -0
  78. {algorand_python_testing-0.3.0b4/examples/htlc_logicsig → algorand_python_testing-0.3.0b6/examples/auction}/__init__.py +0 -0
  79. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/auction/contract.py +0 -0
  80. {algorand_python_testing-0.3.0b4/examples/marketplace → algorand_python_testing-0.3.0b6/examples/htlc_logicsig}/__init__.py +0 -0
  81. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/htlc_logicsig/signature.py +0 -0
  82. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/htlc_logicsig/test_signature.py +0 -0
  83. {algorand_python_testing-0.3.0b4/examples/proof_of_attendance → algorand_python_testing-0.3.0b6/examples/marketplace}/__init__.py +0 -0
  84. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/marketplace/contract.py +0 -0
  85. {algorand_python_testing-0.3.0b4/examples/scratch_storage → algorand_python_testing-0.3.0b6/examples/proof_of_attendance}/__init__.py +0 -0
  86. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/proof_of_attendance/contract.py +0 -0
  87. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/proof_of_attendance/test_contract.py +0 -0
  88. {algorand_python_testing-0.3.0b4/examples/simple_voting → algorand_python_testing-0.3.0b6/examples/scratch_storage}/__init__.py +0 -0
  89. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/scratch_storage/contract.py +0 -0
  90. {algorand_python_testing-0.3.0b4/examples/zk_whitelist → algorand_python_testing-0.3.0b6/examples/simple_voting}/__init__.py +0 -0
  91. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/simple_voting/contract.py +0 -0
  92. {algorand_python_testing-0.3.0b4/scripts → algorand_python_testing-0.3.0b6/examples/zk_whitelist}/__init__.py +0 -0
  93. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/examples/zk_whitelist/contract.py +0 -0
  94. {algorand_python_testing-0.3.0b4/tests → algorand_python_testing-0.3.0b6/scripts}/__init__.py +0 -0
  95. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/scripts/check_stubs_cov.py +0 -0
  96. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/scripts/refresh_test_artifacts.py +0 -0
  97. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/scripts/validate_examples.py +0 -0
  98. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy/__init__.py +0 -0
  99. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy/arc4.py +0 -0
  100. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy/gtxn.py +0 -0
  101. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy/itxn.py +0 -0
  102. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy/op.py +0 -0
  103. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy/py.typed +0 -0
  104. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_compiled.py +0 -0
  105. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_context_helpers/__init__.py +0 -0
  106. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_context_helpers/context_storage.py +0 -0
  107. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_itxn_loader.py +0 -0
  108. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_value_generators/__init__.py +0 -0
  109. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_value_generators/arc4.py +0 -0
  110. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/_value_generators/txn.py +0 -0
  111. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/constants.py +0 -0
  112. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/decorators/__init__.py +0 -0
  113. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/decorators/subroutine.py +0 -0
  114. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/gtxn.py +0 -0
  115. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/itxn.py +0 -0
  116. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/__init__.py +0 -0
  117. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/account.py +0 -0
  118. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/application.py +0 -0
  119. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/asset.py +0 -0
  120. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/logicsig.py +0 -0
  121. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/template_variable.py +0 -0
  122. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/txn_fields.py +0 -0
  123. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/models/unsigned_builtins.py +0 -0
  124. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/__init__.py +0 -0
  125. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/block.py +0 -0
  126. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/constants.py +0 -0
  127. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/crypto.py +0 -0
  128. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/global_values.py +0 -0
  129. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/itxn.py +0 -0
  130. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/misc.py +0 -0
  131. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/pure.py +0 -0
  132. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/op/txn.py +0 -0
  133. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/primitives/__init__.py +0 -0
  134. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/primitives/biguint.py +0 -0
  135. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/primitives/bytes.py +0 -0
  136. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/primitives/string.py +0 -0
  137. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/protocols.py +0 -0
  138. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/py.typed +0 -0
  139. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/state/__init__.py +0 -0
  140. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/state/utils.py +0 -0
  141. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/utilities/__init__.py +0 -0
  142. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/utilities/budget.py +0 -0
  143. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/src/algopy_testing/utilities/log.py +0 -0
  144. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/templates/.macros.j2 +0 -0
  145. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/templates/.release_notes.md.j2 +0 -0
  146. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/templates/CHANGELOG.md.j2 +0 -0
  147. {algorand_python_testing-0.3.0b4/tests/arc4 → algorand_python_testing-0.3.0b6/tests}/__init__.py +0 -0
  148. {algorand_python_testing-0.3.0b4/tests/artifacts/Arc4ABIMethod → algorand_python_testing-0.3.0b6/tests/arc4}/__init__.py +0 -0
  149. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/conftest.py +0 -0
  150. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/test_abi_call.py +0 -0
  151. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/test_address.py +0 -0
  152. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/test_bool.py +0 -0
  153. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/test_dynamic_array.py +0 -0
  154. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/test_dynamic_bytes.py +0 -0
  155. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/test_emit.py +0 -0
  156. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/test_static_array.py +0 -0
  157. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/test_string.py +0 -0
  158. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/test_struct.py +0 -0
  159. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/test_tuple.py +0 -0
  160. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/test_ufixednxm.py +0 -0
  161. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/arc4/test_uintn.py +0 -0
  162. {algorand_python_testing-0.3.0b4/tests/artifacts/Arc4InnerTxns → algorand_python_testing-0.3.0b6/tests/artifacts/Arc4ABIMethod}/__init__.py +0 -0
  163. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4ABIMethod/contract.py +0 -0
  164. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.approval.teal +0 -0
  165. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.arc32.json +0 -0
  166. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.clear.teal +0 -0
  167. {algorand_python_testing-0.3.0b4/tests/artifacts/Arc4PrimitiveOps → algorand_python_testing-0.3.0b6/tests/artifacts/Arc4InnerTxns}/__init__.py +0 -0
  168. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4InnerTxns/contract.py +0 -0
  169. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.approval.teal +0 -0
  170. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.arc32.json +0 -0
  171. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.clear.teal +0 -0
  172. {algorand_python_testing-0.3.0b4/tests/artifacts/BoxContract → algorand_python_testing-0.3.0b6/tests/artifacts/Arc4PrimitiveOps}/__init__.py +0 -0
  173. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4PrimitiveOps/contract.py +0 -0
  174. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.approval.teal +0 -0
  175. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.arc32.json +0 -0
  176. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.clear.teal +0 -0
  177. {algorand_python_testing-0.3.0b4/tests/artifacts/CryptoOps → algorand_python_testing-0.3.0b6/tests/artifacts/BoxContract}/__init__.py +0 -0
  178. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/BoxContract/contract.py +0 -0
  179. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/BoxContract/data/BoxContract.approval.teal +0 -0
  180. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/BoxContract/data/BoxContract.arc32.json +0 -0
  181. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/BoxContract/data/BoxContract.clear.teal +0 -0
  182. {algorand_python_testing-0.3.0b4/tests/artifacts/GlobalStateValidator → algorand_python_testing-0.3.0b6/tests/artifacts/CryptoOps}/__init__.py +0 -0
  183. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/CryptoOps/contract.py +0 -0
  184. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/CryptoOps/data/CryptoOpsContract.approval.teal +0 -0
  185. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/CryptoOps/data/CryptoOpsContract.arc32.json +0 -0
  186. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/CryptoOps/data/CryptoOpsContract.clear.teal +0 -0
  187. {algorand_python_testing-0.3.0b4/tests/artifacts/MiscellaneousOps → algorand_python_testing-0.3.0b6/tests/artifacts/GlobalStateValidator}/__init__.py +0 -0
  188. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/GlobalStateValidator/contract.py +0 -0
  189. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.approval.teal +0 -0
  190. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.arc32.json +0 -0
  191. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.clear.teal +0 -0
  192. {algorand_python_testing-0.3.0b4/tests/artifacts/PrimitiveOps → algorand_python_testing-0.3.0b6/tests/artifacts/MiscellaneousOps}/__init__.py +0 -0
  193. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/MiscellaneousOps/contract.py +0 -0
  194. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.approval.teal +0 -0
  195. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.arc32.json +0 -0
  196. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.clear.teal +0 -0
  197. {algorand_python_testing-0.3.0b4/tests/artifacts/StateOps → algorand_python_testing-0.3.0b6/tests/artifacts/PrimitiveOps}/__init__.py +0 -0
  198. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/PrimitiveOps/contract.py +0 -0
  199. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.approval.teal +0 -0
  200. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.arc32.json +0 -0
  201. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.clear.teal +0 -0
  202. {algorand_python_testing-0.3.0b4/tests/artifacts → algorand_python_testing-0.3.0b6/tests/artifacts/StateMutations}/__init__.py +0 -0
  203. {algorand_python_testing-0.3.0b4/tests/contexts → algorand_python_testing-0.3.0b6/tests/artifacts/StateOps}/__init__.py +0 -0
  204. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/contract.py +0 -0
  205. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/GlobalStateContract.approval.teal +0 -0
  206. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/GlobalStateContract.arc32.json +0 -0
  207. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/GlobalStateContract.clear.teal +0 -0
  208. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/ITxnOpsContract.approval.teal +0 -0
  209. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/ITxnOpsContract.arc32.json +0 -0
  210. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/ITxnOpsContract.clear.teal +0 -0
  211. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/LocalStateContract.approval.teal +0 -0
  212. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/LocalStateContract.arc32.json +0 -0
  213. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/LocalStateContract.clear.teal +0 -0
  214. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAcctParamsGet.approval.teal +0 -0
  215. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAcctParamsGet.arc32.json +0 -0
  216. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAcctParamsGet.clear.teal +0 -0
  217. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.approval.teal +0 -0
  218. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.arc32.json +0 -0
  219. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.clear.teal +0 -0
  220. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppGlobalContract.approval.teal +0 -0
  221. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppGlobalContract.arc32.json +0 -0
  222. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppGlobalContract.clear.teal +0 -0
  223. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppGlobalExContract.approval.teal +0 -0
  224. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppGlobalExContract.arc32.json +0 -0
  225. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppGlobalExContract.clear.teal +0 -0
  226. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppLocalContract.approval.teal +0 -0
  227. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppLocalContract.arc32.json +0 -0
  228. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppLocalContract.clear.teal +0 -0
  229. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppLocalExContract.approval.teal +0 -0
  230. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppLocalExContract.arc32.json +0 -0
  231. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppLocalExContract.clear.teal +0 -0
  232. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppParamsContract.approval.teal +0 -0
  233. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppParamsContract.arc32.json +0 -0
  234. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAppParamsContract.clear.teal +0 -0
  235. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAssetHoldingContract.approval.teal +0 -0
  236. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAssetHoldingContract.arc32.json +0 -0
  237. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAssetHoldingContract.clear.teal +0 -0
  238. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAssetParamsContract.approval.teal +0 -0
  239. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAssetParamsContract.arc32.json +0 -0
  240. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/artifacts/StateOps/data/StateAssetParamsContract.clear.teal +0 -0
  241. {algorand_python_testing-0.3.0b4/tests/models → algorand_python_testing-0.3.0b6/tests/artifacts}/__init__.py +0 -0
  242. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/conftest.py +0 -0
  243. {algorand_python_testing-0.3.0b4/tests/primitives → algorand_python_testing-0.3.0b6/tests/contexts}/__init__.py +0 -0
  244. {algorand_python_testing-0.3.0b4/tests/state → algorand_python_testing-0.3.0b6/tests/models}/__init__.py +0 -0
  245. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/models/test_asset.py +0 -0
  246. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/models/test_box.py +0 -0
  247. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/models/test_box_map.py +0 -0
  248. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/models/test_box_ref.py +0 -0
  249. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/models/test_uenumerate.py +0 -0
  250. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/models/test_urange.py +0 -0
  251. {algorand_python_testing-0.3.0b4/tests/utilities → algorand_python_testing-0.3.0b6/tests/primitives}/__init__.py +0 -0
  252. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/primitives/conftest.py +0 -0
  253. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/primitives/test_biguint.py +0 -0
  254. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/primitives/test_bytes.py +0 -0
  255. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/primitives/test_string.py +0 -0
  256. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/primitives/test_uint64.py +0 -0
  257. {algorand_python_testing-0.3.0b4/tests/value_generators → algorand_python_testing-0.3.0b6/tests/state}/__init__.py +0 -0
  258. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/state/conftest.py +0 -0
  259. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/state/test_global_state.py +0 -0
  260. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/state/test_local_state.py +0 -0
  261. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/test_miscellaneous_op.py +0 -0
  262. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/util.py +0 -0
  263. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/utilities/conftest.py +0 -0
  264. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/utilities/test_log.py +0 -0
  265. {algorand_python_testing-0.3.0b4 → algorand_python_testing-0.3.0b6}/tests/value_generators/test_avm.py +0 -0
@@ -1,4 +1,52 @@
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
+
32
+ ## v0.3.0-beta.5 (2024-08-21)
33
+
34
+ ### Fix
35
+
36
+ * ensure mutable types (ARC4 tuple, array and structs) have their changes propagated back to container-like types (global/local state, boxes, ARC4 mutable types) (#14) ([`1f1f2ea`](https://github.com/algorandfoundation/algorand-python-testing/commit/1f1f2ea43a2f4f906cbcd5709b8e86b5c1f2bc63))
37
+
38
+ * fix: add default __eq__ implementation for ARC4 types
39
+
40
+ * fix: ensure mutable types (ARC4 tuple, array and structs) have their changes propagated back to container-like types (global/local state, boxes, ARC4 mutable types)
41
+
42
+ * feat: add __str__ and __repr__ implementations for ARC4 types
43
+
44
+ * refactor: make ARC4 type_info private
45
+
46
+ * refactor: make ARC4 struct inherit _ABIEncoded
47
+
48
+ * refactor: removing get_app_for_contract; expanding get_app; parsing on_complete
49
+
2
50
  ## v0.3.0-beta.4 (2024-08-21)
3
51
 
4
52
  ### Feature
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: algorand-python-testing
3
- Version: 0.3.0b4
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
- with algopy_testing_context() as ctx:
61
- contract = YourContract() # Your test code here
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
- with algopy_testing_context() as ctx:
38
- contract = YourContract() # Your test code here
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)
@@ -2,7 +2,8 @@
2
2
  Hide the first element of attribute like items as algopy stubs are more like interfaces and as such
3
3
  should not indicate a specific "value" for variables
4
4
  */
5
- .py.data,.py.attribute {
5
+ .py.data,
6
+ .py.attribute {
6
7
  dd p:first-child {
7
8
  display: none;
8
9
  }
@@ -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
- "colon_fence",
57
- "fieldlist",
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
+ [![docs-repository](https://img.shields.io/badge/url-repository-74dfdc?logo=github&style=flat.svg)](https://github.com/algorandfoundation/algorand-python-testing/)
4
+ [![learn-AlgoKit](https://img.shields.io/badge/learn-AlgoKit-74dfdc?logo=algorand&mac=flat.svg)](https://developer.algorand.org/algokit/)
5
+ [![github-stars](https://img.shields.io/github/stars/algorandfoundation/algorand-python-testing?color=74dfdc&logo=star&style=flat)](https://github.com/algorandfoundation/algorand-python-testing)
6
+ [![visitor-badge](https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Falgorandfoundation%2Falgorand-python-testing&countColor=%2374dfdc&style=flat)](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
+ ```