Exemplo n.º 1
0
def test_make_request():
    from transactions.services.daemonservice import BitcoinDaemonService
    s = BitcoinDaemonService('a', 'b', 'bitcoin', 18332)
    response = s.make_request('getinfo')
    assert 'id' in response
    assert 'error' in response
    assert 'result' in response
Exemplo n.º 2
0
def test_make_request_connection_error():
    from transactions.services.daemonservice import BitcoinDaemonService
    s = BitcoinDaemonService('u', 'p', 'h', 12345, testnet=True)
    with pytest.raises(ConnectionError):
        s.make_request('getinfo')
Exemplo n.º 3
0
def test_make_request_invalid_url():
    from transactions.services.daemonservice import BitcoinDaemonService
    s = BitcoinDaemonService('merlin', 'secret', 'bitcoin', 'p', testnet=True)
    with pytest.raises(InvalidURL):
        s.make_request('getinfo')
def test_make_request_connection_error():
    from transactions.services.daemonservice import BitcoinDaemonService
    s = BitcoinDaemonService('u', 'p', 'h', 12345, testnet=True)
    with pytest.raises(ConnectionError):
        s.make_request('getinfo')
def test_make_request_invalid_url():
    from transactions.services.daemonservice import BitcoinDaemonService
    s = BitcoinDaemonService('merlin', 'secret', 'bitcoin', 'p', testnet=True)
    with pytest.raises(InvalidURL):
        s.make_request('getinfo')
def bitcoin_daemon_service(rpcuser, rpcpassword, host, port, rpcurl):
    from transactions.services.daemonservice import BitcoinDaemonService
    return BitcoinDaemonService(rpcuser, rpcpassword, host, port)