Skip to content

Commit d4de94c

Browse files
authored
Merge pull request #633 from eynhaender/master
Apply Python naming conventions
2 parents 03d8df4 + eb1e841 commit d4de94c

5 files changed

Lines changed: 35 additions & 35 deletions

File tree

test/endpoints/README.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ 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 | `native.py` | 🔧 In Progress |
12-
| **bitcoind RPC** | HTTP/S + JSON-RPC 2.0 | `bitcoind_rpc.py` | 🔧 In Progress |
13-
| **Electrum** | TCP + JSON-RPC 2.0 | `electrum.py` | 🔧 In Progress |
14-
| **bitcoind REST** | HTTP/S + JSON/Binary | `bitcoind_rest.py` | 🚧 Planned |
15-
| **Stratum v1** | TCP + JSON-RPC 1.0 | `stratum_v1.py` | 🚧 Planned |
16-
| **Stratum v2** | TCP + Binary | `stratum_v2.py` | 🚧 Planned |
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 |
14+
| **bitcoind REST** | HTTP/S + JSON/Binary | `test_bitcoind_rest.py` | 🚧 Planned |
15+
| **Stratum v1** | TCP + JSON-RPC 1.0 | `test_stratum_v1.py` | 🚧 Planned |
16+
| **Stratum v2** | TCP + Binary | `test_stratum_v2.py` | 🚧 Planned |
1717

1818
## Prerequisites
1919

@@ -74,19 +74,19 @@ This uses default localhost endpoints:
7474

7575
```bash
7676
# Test only native REST
77-
pytest native.py
77+
pytest test_native.py
7878

7979
# Test only bitcoind RPC
80-
pytest bitcoind_rpc.py
80+
pytest test_bitcoind_rpc.py
8181

8282
# Test only Electrum protocol
83-
pytest electrum.py
83+
pytest test_electrum.py
8484
```
8585

8686
### Run with Verbose Output
8787

8888
```bash
89-
pytest -v native.py
89+
pytest -v test_native.py
9090
pytest -v --tb=short # Shorter tracebacks
9191
pytest -vv # Very verbose
9292
```
@@ -98,7 +98,7 @@ All tests accept command-line parameters to specify target hosts and ports.
9898
### Native / REST Options
9999

100100
```bash
101-
pytest native.py \
101+
pytest test_native.py \
102102
--native-host=192.168.1.100 \
103103
--native-port=8181
104104
```
@@ -110,15 +110,15 @@ pytest native.py \
110110
### bitcoind RPC Options
111111

112112
```bash
113-
pytest bitcoind_rpc.py \
113+
pytest test_bitcoind_rpc.py \
114114
--bitcoind-rpc-host=localhost \
115115
--bitcoind-rpc-port=8332
116116
```
117117

118118
**With authentication (for Bitcoin Core):**
119119

120120
```bash
121-
pytest bitcoind_rpc.py \
121+
pytest test_bitcoind_rpc.py \
122122
--bitcoind-auth \
123123
--bitcoind-cookie=/path/to/.cookie
124124
```
@@ -132,15 +132,15 @@ pytest bitcoind_rpc.py \
132132
### Electrum Protocol Options
133133

134134
```bash
135-
pytest electrum.py \
135+
pytest test_electrum.py \
136136
--electrum-host=localhost \
137137
--electrum-port=50001
138138
```
139139

140140
**Test against public Electrum server:**
141141

142142
```bash
143-
pytest electrum.py \
143+
pytest test_electrum.py \
144144
--electrum-host=fulcrum.sethforprivacy.com \
145145
--electrum-port=50001
146146
```
@@ -156,15 +156,15 @@ pytest electrum.py \
156156
pytest --timeout=60
157157

158158
# Combine multiple options
159-
pytest native.py \
159+
pytest test_native.py \
160160
--native-host=192.168.1.100 \
161161
--native-port=8181 \
162162
--timeout=30
163163
```
164164

165165
## Test Organization
166166

167-
### native.py - Native REST
167+
### test_native.py - Native REST
168168

169169
Tests the `/v1/` HTTP REST endpoints for blockchain exploration.
170170

@@ -181,19 +181,19 @@ Tests the `/v1/` HTTP REST endpoints for blockchain exploration.
181181

182182
```bash
183183
# Run all native tests
184-
pytest native.py
184+
pytest test_native.py
185185

186186
# Run only block-related tests
187-
pytest native.py -k "block"
187+
pytest test_native.py -k "block"
188188

189189
# Run only transaction tests
190-
pytest native.py -k "tx"
190+
pytest test_native.py -k "tx"
191191

192192
# Skip slow address tests
193-
pytest native.py -k "not address"
193+
pytest test_native.py -k "not address"
194194
```
195195

196-
### bitcoind_rpc.py - bitcoind RPC Compatibility
196+
### test_bitcoind_rpc.py - bitcoind RPC Compatibility
197197

198198
Tests JSON-RPC 2.0 interface compatible with Bitcoin Core RPC.
199199

@@ -214,19 +214,19 @@ Tests JSON-RPC 2.0 interface compatible with Bitcoin Core RPC.
214214

215215
```bash
216216
# Test against libbitcoin-server
217-
pytest bitcoind_rpc.py
217+
pytest test_bitcoind_rpc.py
218218

219219
# Test against Bitcoin Core (with auth)
220-
pytest bitcoind_rpc.py \
220+
pytest test_bitcoind_rpc.py \
221221
--bitcoind-rpc-port=9333 \
222222
--bitcoind-auth \
223223
--bitcoind-cookie=/path/to/.cookie
224224

225225
# Run only getblock* methods
226-
pytest bitcoind_rpc.py -k "getblock"
226+
pytest test_bitcoind_rpc.py -k "getblock"
227227
```
228228

229-
### electrum.py - Electrum Protocol
229+
### test_electrum.py - Electrum Protocol
230230

231231
Tests Electrum Protocol 1.4.2 JSON-RPC over TCP.
232232

@@ -241,15 +241,15 @@ Tests Electrum Protocol 1.4.2 JSON-RPC over TCP.
241241

242242
```bash
243243
# Test against local Electrum server
244-
pytest electrum.py
244+
pytest test_electrum.py
245245

246246
# Test against public server
247-
pytest electrum.py \
247+
pytest test_electrum.py \
248248
--electrum-host=electrum.blockstream.info \
249249
--electrum-port=50001
250250

251251
# Run only server methods
252-
pytest electrum.py -k "server"
252+
pytest test_electrum.py -k "server"
253253
```
254254

255255
## Advanced Usage
@@ -258,26 +258,26 @@ pytest electrum.py -k "server"
258258

259259
```bash
260260
# Run a single test by name
261-
pytest native.py::test_configuration
261+
pytest test_native.py::test_configuration
262262

263263
# Run multiple specific tests
264-
pytest native.py::test_block_by_hash test_native.py::test_block_by_height
264+
pytest test_native.py::test_block_by_hash test_native.py::test_block_by_height
265265

266266
# Run tests matching pattern
267-
pytest native.py -k "block_filter"
267+
pytest test_native.py -k "block_filter"
268268
```
269269

270270
### Pytest Markers
271271

272272
```bash
273273
# Skip marked tests
274-
pytest native.py -m "not skip"
274+
pytest test_native.py -m "not skip"
275275

276276
# Run only slow tests
277-
pytest native.py -m "slow"
277+
pytest test_native.py -m "slow"
278278

279279
# Run parametrized tests with specific parameter
280-
pytest native.py -k "filter_type-bloom"
280+
pytest test_native.py -k "filter_type-bloom"
281281
```
282282

283283
### Output Formats

0 commit comments

Comments
 (0)