Skip to content

test: add TestResources for 7 MCP resources (closes #7)#27

Closed
ThomsenDrake wants to merge 2 commits intoBortlesboat:mainfrom
ThomsenDrake:mcp-resource-tests
Closed

test: add TestResources for 7 MCP resources (closes #7)#27
ThomsenDrake wants to merge 2 commits intoBortlesboat:mainfrom
ThomsenDrake:mcp-resource-tests

Conversation

@ThomsenDrake
Copy link
Copy Markdown
Contributor

Summary

Adds a TestResources class with 7 tests covering all zero-coverage MCP resources from issue #7:

Test Resource Type
test_resource_script_opcodes bitcoin://protocol/script-opcodes Static
test_resource_address_types bitcoin://protocol/address-types Static
test_resource_sighash_types bitcoin://protocol/sighash-types Static
test_resource_connection_status bitcoin://connection/status Dynamic
test_resource_node_status bitcoin://node/status Dynamic
test_resource_current_fees bitcoin://fees/current Dynamic
test_resource_mempool_snapshot bitcoin://mempool/snapshot Dynamic

Approach

  • Static resources (opcodes, address types, sighash types): validate returned JSON structure and presence of known keys
  • Dynamic resources (connection status, node status, fees, mempool): use the existing mock_rpc fixture which already mocks all required RPC calls

Test results

All 131 tests pass (124 existing + 7 new):

tests/test_server.py::TestResources::test_resource_script_opcodes PASSED
tests/test_server.py::TestResources::test_resource_address_types PASSED
tests/test_server.py::TestResources::test_resource_sighash_types PASSED
tests/test_server.py::TestResources::test_resource_connection_status PASSED
tests/test_server.py::TestResources::test_resource_node_status PASSED
tests/test_server.py::TestResources::test_resource_current_fees PASSED
tests/test_server.py::TestResources::test_resource_mempool_snapshot PASSED
``"

Closes #7

Drake Thomsen added 2 commits April 11, 2026 23:31
Add 7 tests covering all zero-coverage MCP resources:
- test_resource_script_opcodes (static, validates opcode structure)
- test_resource_address_types (static, validates address type list)
- test_resource_sighash_types (static, validates sighash type list)
- test_resource_connection_status (dynamic, uses mock_rpc)
- test_resource_node_status (dynamic, uses mock_rpc)
- test_resource_current_fees (dynamic, uses mock_rpc)
- test_resource_mempool_snapshot (dynamic, uses mock_rpc)

Static resources validate returned JSON structure.
Dynamic resources use the mock_rpc fixture (conftest.py).
All 131 tests pass (124 existing + 7 new).
@Bortlesboat
Copy link
Copy Markdown
Owner

Closing this as superseded by #31, which consolidates the open backlog work into one maintainer sweep. Thank you for the contribution and the concrete issue coverage here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants