コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
def test_dev_geth_process_generates_accounts(base_dir):
    geth = DevGethProcess('testing', base_dir=base_dir)
    assert len(geth.accounts) == 1
コード例 #4
0
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)
コード例 #5
0
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(gevent.Timeout):
            geth.wait_for_ipc(timeout=0.1)
        assert geth.is_running
コード例 #6
0
def test_waiting_for_rpc_connection(base_dir):
    with DevGethProcess('testing', base_dir=base_dir) as geth:
        geth.wait_for_rpc(timeout=60)
        assert geth.is_running
コード例 #7
0
def test_timeout_waiting_for_rpc_connection(base_dir):
    with DevGethProcess('testing', base_dir=base_dir) as geth:
        with pytest.raises(gevent.Timeout):
            geth.wait_for_rpc(timeout=0.1)