Skip to content

test(sdk): CliRunner suite for every Python SDK CLI command (bounty #17181) - #8642

Open
bhanub05 wants to merge 4 commits into
Scottcjn:mainfrom
bhanub05:main
Open

bhanub05 wants to merge 4 commits into
Scottcjn:mainfrom
bhanub05:main

Conversation

@bhanub05

@bhanub05 bhanub05 commented Nov 7, 2026

Copy link
Copy Markdown

Closes Scottcjn/rustchain-bounties#17181

Summary

Adds sdk/python/tests/test_cli.py — a click.testing.CliRunner suite for rustchain_sdk/cli.py, which previously had no tests.

Command → test mapping

Command Success / output --json Error paths
--version, --help test_version, test_help[*] — test_unknown_command_fails
wallet create test_wallet_create_human test_wallet_create_json[12/24] test_wallet_create_rejects_bad_word_count, …_non_integer_words
wallet balance test_wallet_balance_human, …_node_url_is_used test_wallet_balance_json …_missing_address, unreachable / 4xx / 5xx / non-JSON / array / redirect, #8580 ×2
wallet send test_wallet_send_human, …_signature_verifies test_wallet_send_json seed mismatch, missing --seed / AMOUNT, abc amount/fee, negative (xfail), zero (xfail), invalid chain_id, node 400, unreachable / 4xx / 5xx, #8564 ×3, #8618 ×4
node test_node_human_healthy, …_degraded test_node_json unreachable / 4xx / 5xx / non-JSON / array / redirect, #8565
epoch test_epoch_human test_epoch_json unreachable / 4xx / 5xx / non-JSON / array / redirect, #8565
miners list test_miners_list_human[*], …_empty test_miners_list_json unreachable / 4xx / 5xx / redirect, non-JSON 200 → empty
attest test_attest_human_full_flow, …_no_challenge test_attest_json_outputs_valid_json seed mismatch, missing --seed, invalid seed (xfail), unreachable / 4xx / 5xx, #8566

Test output ======================== 95 passed, 15 xfailed in 0.54s ========================

Add comprehensive CLI test suite for rustchain_sdk.cli using pytest and click testing.
This workflow runs tests for the Python SDK CLI on push and pull request events for specific paths. It supports multiple Python versions and installs development dependencies before executing the test suite.
@bhanub05
bhanub05 requested a review from Scottcjn as a code owner November 7, 2026 18:21
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Welcome to RustChain! Thanks for your first pull request.

Before we review, please make sure:

  • Non-doc PRs have a BCOS-L1 or BCOS-L2 label
  • Doc-only PRs are exempt from BCOS tier labels when they only touch docs/**, *.md, or common image/PDF files
  • New code files include an SPDX license header
  • You've tested your changes against the live node

Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150)

A maintainer will review your PR soon. Thanks for contributing!

@github-actions github-actions Bot added BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) ci size/XL PR: 500+ lines labels Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

This PR is quite large (XL). Consider splitting into smaller, focused PRs for faster review. Large PRs take longer to review and have higher risk of issues.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Nov 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) ci documentation Improvements or additions to documentation size/XL PR: 500+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOUNTY: 15 RTC] Python SDK CLI has zero tests — add a Click CliRunner suite for every command (wallet/node/epoch/miners/attest)

1 participant