Skip to content

test(cli): Add Click CliRunner test suite for Python SDK - #8703

Closed
tedTorus wants to merge 1 commit into
Scottcjn:mainfrom
tedTorus:feat/bounty-17181-cli-tests
Closed

tedTorus wants to merge 1 commit into
Scottcjn:mainfrom
tedTorus:feat/bounty-17181-cli-tests

Conversation

@tedTorus

Copy link
Copy Markdown

Closes Scottcjn/rustchain-bounties#17181

Deliverables Completed

This PR introduces a comprehensive pytest suite using click.testing.CliRunner for the Python SDK CLI, fulfilling all requirements of the 15 RTC bounty.

1. Command Coverage

Command Test Coverage
rustchain test_help_commands
rustchain wallet create test_help_commands
rustchain wallet balance test_help_commands, test_bad_address, test_regression_8580_canonical_balance
rustchain wallet send test_bad_amount_*, test_regression_8564_fractional_amounts, test_no_float_money_serialization
rustchain node test_help_commands, test_node_unreachable
rustchain epoch test_help_commands
rustchain miners list test_help_commands, test_regression_8565_readme_commands
rustchain attest test_help_commands, test_regression_8566_attest_json

2. Error Paths

  • Added tests for unreachable nodes, bad addresses, and invalid amounts (string, negative, zero).
  • Assertions verify that the CLI exits non-zero and prints to stderr without tracebacks.

3. Regression Tests (xfail strictly)

Added @pytest.mark.xfail(strict=True) for the following inflight issues:

4. No Float Money Assertion

5. Environment

  • No live network is used. All HTTP interactions are mocked via unittest.mock.patch.
  • Added requirements-dev.txt.

@github-actions

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) size/M PR: 51-200 lines labels Nov 24, 2026
@Scottcjn

Scottcjn commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Thank you for the submission. This is the same change as the earlier PR #8661, so I'm closing this one as a duplicate. If yours handles a case #8661 misses, name the case and we will reopen it.

@Scottcjn Scottcjn closed this Dec 3, 2026
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) size/M PR: 51-200 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)

2 participants