tests.test_bitcoin

Classes

TestBitcoinEmulator([methodName])

class tests.test_bitcoin.TestBitcoinEmulator(methodName='runTest')[source]
EXTERNAL_ADDRESS = '13J8HRihYqEDYHAxLciryQYTjpxXcjYMmR'

A Bitcoin address considered ‘foreign’ for testing that sending reduces balance

LOCAL_ADDRESS = '1PNgW6AgPZMys844kFS2dK4tt7F36MzLC8'

A Bitcoin address considered to be in the wallet

emulator = None

Stores the Process returned from bitcoin.j_server()

classmethod setUpClass() → None[source]

Launch the Bitcoin RPC emulator in the background on default port 8332

classmethod tearDownClass() → None[source]

Shutdown the Bitcoin RPC emulator process

test_get_transaction()[source]

Test gettransaction returns the correct transaction

test_getblockchaininfo()[source]

Test that the getblockchaininfo JsonRPC call returns data as expected

test_getnetworkinfo()[source]

Test that the getnetworkinfo JsonRPC call returns data as expected

test_getnewaddress()[source]

Get a new address from the emulator and confirm it seems like a BTC address

test_send_valid()[source]

Test sending coins to external address creates a TX in listtransactions, and reduces the balance

test_validate_address()[source]

Test validateaddress with a valid and invalid address