mirror of
https://github.com/cryptoadvance/specter-desktop.git
synced 2026-08-13 12:33:29 +02:00
* automate pip-packages-gen + upload for gittags release documentation proper package including and static + templates * Change import- and start logic, removed cli.py * project-renaming to cryptoadvance.specter propoer packaging include proper dependencies * Adding requirements.txt * Specify maintainers and thanks to contributors * Removing test-url for pip-uload. This is now live!
23 lines
764 B
Python
23 lines
764 B
Python
import pytest
|
|
|
|
from cryptoadvance.specter.rpc import BitcoinCLI, RpcError
|
|
|
|
def test_BitcoinCli(bitcoin_regtest):
|
|
brt = bitcoin_regtest # stupid long name
|
|
cli = BitcoinCLI(brt.rpcconn.rpcuser, brt.rpcconn.rpcpassword, host=brt.rpcconn.ipaddress, port=brt.rpcconn.rpcport)
|
|
cli.getblockchaininfo()
|
|
# To investigate the Bitcoin API, here are some great resources:
|
|
# https://bitcoin.org/en/developer-reference#bitcoin-core-apis
|
|
# https://chainquery.com/bitcoin-cli
|
|
# https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line
|
|
|
|
# Errorhandling:
|
|
try:
|
|
cli.getSomethingNonExisting()
|
|
except RpcError as rpce:
|
|
assert rpce.error_code == -32601
|
|
assert rpce.error_msg == "Method not found"
|
|
|
|
|
|
|
|
|