specter-desktop/tests/test_rpc.py
Kim Neunert 556ec5f961
Releasing procedure with pip (#69)
* 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!
2020-02-20 13:00:53 +01:00

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"