def start_geth(self): geth_proc = DevGethProcess( chain_name=current_app.config.get('FLASKWEB3_CHAIN_NAME'), base_dir=get_blockchains_dir( current_app.config.get('FLASKWEB3_PROJECTDIR'))) geth_proc.start() return geth_proc
def test_timeout_waiting_for_ipc_socket(base_dir, _amend_geth_overrides_for_1_9): with DevGethProcess('testing', base_dir=base_dir, overrides=_amend_geth_overrides_for_1_9) as geth: assert geth.is_running with pytest.raises(Timeout): geth.wait_for_ipc(timeout=0.01)
def test_using_as_a_context_manager(base_dir): geth = DevGethProcess('testing', base_dir=base_dir) assert not geth.is_running assert not geth.is_alive with geth: assert geth.is_running assert geth.is_alive assert geth.is_stopped
def test_with_no_overrides(base_dir): geth = DevGethProcess('testing', base_dir=base_dir) geth.start() assert geth.is_running assert geth.is_alive geth.stop() assert geth.is_stopped
def test_timeout_waiting_for_ipc_socket(base_dir): with DevGethProcess('testing', base_dir=base_dir) as geth: assert geth.is_running with pytest.raises(Timeout): geth.wait_for_ipc(timeout=0.1) assert geth.is_running
def test_waiting_for_ipc_socket(base_dir): with DevGethProcess('testing', base_dir=base_dir) as geth: assert geth.is_running geth.wait_for_ipc(timeout=60)
def test_waiting_for_rpc_connection(base_dir): with DevGethProcess('testing', base_dir=base_dir) as geth: assert geth.is_running geth.wait_for_rpc(timeout=60)
def test_timeout_waiting_for_rpc_connection(base_dir): with DevGethProcess('testing', base_dir=base_dir) as geth: with pytest.raises(Timeout): geth.wait_for_rpc(timeout=0.1)
def test_dev_geth_process_generates_accounts(base_dir): geth = DevGethProcess('testing', base_dir=base_dir) assert len(geth.accounts) == 1
def test_timeout_waiting_for_rpc_connection(base_dir, _amend_geth_overrides_for_1_9): with DevGethProcess('testing', base_dir=base_dir, overrides=_amend_geth_overrides_for_1_9) as geth: with pytest.raises(Timeout): geth.wait_for_rpc(timeout=0.1)
def test_waiting_for_rpc_connection(base_dir, _amend_geth_overrides_for_1_9): with DevGethProcess('testing', base_dir=base_dir, overrides=_amend_geth_overrides_for_1_9) as geth: assert geth.is_running geth.wait_for_rpc(timeout=60)