Changeset View
Changeset View
Standalone View
Standalone View
doc/functional-tests.md
Show First 20 Lines • Show All 328 Lines • ▼ Show 20 Lines | |||||
- `P2PConnection` is the class used to connect to a bitcoind. `P2PInterface` | - `P2PConnection` is the class used to connect to a bitcoind. `P2PInterface` | ||||
contains the higher level logic for processing P2P payloads and connecting to | contains the higher level logic for processing P2P payloads and connecting to | ||||
the Bitcoin Core node application logic. For custom behaviour, subclass the | the Bitcoin Core node application logic. For custom behaviour, subclass the | ||||
P2PInterface object and override the callback methods. | P2PInterface object and override the callback methods. | ||||
- Can be used to write tests where specific P2P protocol behavior is tested. | - Can be used to write tests where specific P2P protocol behavior is tested. | ||||
Examples tests are `p2p-acceptblock.py`, `p2p-compactblocks.py`. | Examples tests are `p2p-acceptblock.py`, `p2p-compactblocks.py`. | ||||
#### Prototyping tests | |||||
The [`TestShell`](test-shell.md) class exposes the BitcoinTestFramework | |||||
functionality to interactive Python3 environments and can be used to prototype | |||||
tests. This may be especially useful in a REPL environment with session logging | |||||
utilities, such as | |||||
[IPython](https://ipython.readthedocs.io/en/stable/interactive/reference.html#session-logging-and-restoring). | |||||
The logs of such interactive sessions can later be adapted into permanent test | |||||
cases. | |||||
### test-framework modules | ### test-framework modules | ||||
#### [test_framework/authproxy.py](/test/functional/test_framework/authproxy.py) | #### [test_framework/authproxy.py](/test/functional/test_framework/authproxy.py) | ||||
Taken from the [python-bitcoinrpc repository](https://github.com/jgarzik/python-bitcoinrpc). | Taken from the [python-bitcoinrpc repository](https://github.com/jgarzik/python-bitcoinrpc). | ||||
#### [test_framework/test_framework.py](/test/functional/test_framework/test_framework.py) | #### [test_framework/test_framework.py](/test/functional/test_framework/test_framework.py) | ||||
Base class for functional tests. | Base class for functional tests. | ||||
Show All 17 Lines |