Add unit tests for AsyncSubtensor methods #3200
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Unit Tests for AsyncSubtensor Methods
Description
This PR adds 7 new unit tests for the
AsyncSubtensorclass to improve test coverage for critical blockchain interaction methods.Changes
Added the following tests to
tests/unit_tests/test_async_subtensor.py:test_get_stake_with_locked_amounttest_sim_swap_accuracytest_get_subnet_hyperparameters_cachingtest_compose_call_batchtest_sign_and_send_extrinsic_retry_on_network_errortest_get_delegates_lite_vs_fulltest_query_runtime_api_error_handlingTesting
All tests pass:
source venv/bin/activate python -m pytest tests/unit_tests/test_async_subtensor.py::test_get_stake_with_locked_amount \ tests/unit_tests/test_async_subtensor.py::test_sim_swap_accuracy \ tests/unit_tests/test_async_subtensor.py::test_get_subnet_hyperparameters_caching \ tests/unit_tests/test_async_subtensor.py::test_compose_call_batch \ tests/unit_tests/test_async_subtensor.py::test_sign_and_send_extrinsic_retry_on_network_error \ tests/unit_tests/test_async_subtensor.py::test_get_delegates_lite_vs_full \ tests/unit_tests/test_async_subtensor.py::test_query_runtime_api_error_handling -vContribution by Gittensor, learn more at https://gittensor.io/