test_stem.py 696 Bytes
Newer Older
1
2
3
import sbws.util.stem as stem_utils


4
def test_launch_and_okay(persistent_launch_tor):
5
6
    cont = persistent_launch_tor
    assert stem_utils.is_bootstrapped(cont)
7
8
9
10
11
12


def test_set_torrc_runtime_option_succesful(persistent_launch_tor):
    controller = persistent_launch_tor
    runtime_options = controller.get_conf_map(['__LeaveStreamsUnattached'])
    assert runtime_options == {'__LeaveStreamsUnattached': ['1']}
13
14
15
16
17
18
19
20


def test_set_torrc_runtime_invalidrequest_option_fail(persistent_launch_tor):
    controller = persistent_launch_tor
    try:
        controller.set_conf('ControlSocket', '/tmp/dummy')
    except stem_utils.InvalidRequest as e:
        assert "Unable to set option" in e.message