@@ -8,9 +8,9 @@ This directory contains Python-based integration tests for all libbitcoin-server
88
99| Interface | Protocol | Test File | Status |
1010| -----------| ----------| -----------| --------|
11- | ** Native REST** | HTTP/S + JSON | ` test_native.py ` | 🔧 In Progress |
12- | ** bitcoind RPC** | HTTP/S + JSON-RPC 2.0 | ` test_bitcoind_rpc.py ` | 🔧 In Progress |
13- | ** Electrum** | TCP + JSON-RPC 2.0 | ` test_electrum.py ` | 🔧 In Progress |
11+ | ** Native REST** | HTTP/S + JSON | ` test_native.py ` | ✅ Active |
12+ | ** bitcoind RPC** | HTTP/S + JSON-RPC 2.0 | ` test_bitcoind_rpc.py ` | ✅ Active |
13+ | ** Electrum** | TCP + JSON-RPC 2.0 | ` test_electrum.py ` | ✅ Active |
1414| ** bitcoind REST** | HTTP/S + JSON/Binary | ` test_bitcoind_rest.py ` | 🚧 Planned |
1515| ** Stratum v1** | TCP + JSON-RPC 1.0 | ` test_stratum_v1.py ` | 🚧 Planned |
1616| ** Stratum v2** | TCP + Binary | ` test_stratum_v2.py ` | 🚧 Planned |
@@ -231,10 +231,10 @@ pytest test_bitcoind_rpc.py -k "getblock"
231231Tests Electrum Protocol 1.4.2 JSON-RPC over TCP.
232232
233233** Coverage:**
234- - ✅ Server methods (version, banner, features, ping)
235- - ✅ Blockchain methods (headers, estimatefee, relayfee)
236- - ✅ Scripthash methods (balance, history, mempool, listunspent, subscribe)
237- - ✅ Transaction methods (get, id_from_pos)
234+ - ✅ Server methods (version, banner, features, ping, add_peer, donation_address, peers.subscribe )
235+ - ✅ Blockchain methods (block.header, block. headers, headers.subscribe , estimatefee, relayfee)
236+ - ✅ Scripthash methods (balance, history, mempool, listunspent, subscribe, unsubscribe )
237+ - ✅ Transaction methods (get, get_merkle, id_from_pos, broadcast )
238238- ✅ Mempool methods (fee_histogram)
239239
240240** Example test runs:**
@@ -360,6 +360,32 @@ ModuleNotFoundError: No module named 'utils'
360360```
361361** Solution:** Run pytest from the ` test/endpoints/ ` directory or install package in development mode.
362362
363+ ### Request/Response Debug Output
364+
365+ Each test module supports a dedicated environment variable that enables pretty-printed JSON logging of every request and response:
366+
367+ | Test file | Variable | Prints |
368+ | -----------| ----------| --------|
369+ | ` test_electrum.py ` | ` ELECTRUM_DEBUG=1 ` | ` >>> ` JSON-RPC payload / ` <<< ` response with elapsed time |
370+ | ` test_native.py ` | ` NATIVE_DEBUG=1 ` | ` >>> GET <url> ` / ` <<< ` response JSON with elapsed time |
371+ | ` test_bitcoind_rpc.py ` | ` BITCOIND_DEBUG=1 ` | ` >>> ` JSON-RPC payload / ` <<< ` response with elapsed time |
372+
373+ ``` bash
374+ # Electrum — pretty-print all requests and responses
375+ ELECTRUM_DEBUG=1 pytest test_electrum.py -s
376+
377+ # Native REST
378+ NATIVE_DEBUG=1 pytest test_native.py -s
379+
380+ # bitcoind RPC
381+ BITCOIND_DEBUG=1 pytest test_bitcoind_rpc.py -s
382+
383+ # Combine with -k to focus on a single test
384+ ELECTRUM_DEBUG=1 pytest test_electrum.py -s -k " block_headers_20000"
385+ ```
386+
387+ > ** Note:** Use ` -s ` (or ` --capture=no ` ) together with the debug variable so pytest does not suppress stdout.
388+
363389### Debug Mode
364390
365391``` bash
0 commit comments