test: add unit tests for client/_utils.py (get_abi, get_bin, run_with_retry)#254
Open
crazywriter1 wants to merge 1 commit intoOpenGradient:mainfrom
Open
test: add unit tests for client/_utils.py (get_abi, get_bin, run_with_retry)#254crazywriter1 wants to merge 1 commit intoOpenGradient:mainfrom
crazywriter1 wants to merge 1 commit intoOpenGradient:mainfrom
Conversation
Author
…_retry) These three utility functions had zero test coverage. Added 17 tests covering success paths, error handling, nonce retry logic, and edge cases. Signed-off-by: crazywriter1 <crazywriter1@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
get_abi(),get_bin(), andrun_with_retry()insrc/opengradient/client/_utils.pyhad zero test coveragerun_with_retry()is critical infrastructure — it handles blockchain transaction retries on nonce conflicts, but its retry/abort logic was never testedTestGetAbi(3 tests): valid JSON parsing, missing file, malformed JSONTestGetBin(4 tests): with/without0xprefix, whitespace stripping, missing fileTestRunWithRetry(10 tests): first-attempt success, invalid max_retries (0, negative), non-nonce errors raise immediately, retry on each nonce error type (nonce too low,nonce too high,invalid nonce), exhausted retries,max_retries=Nonedefault fallback, case-insensitive nonce matchingTest plan