-
Notifications
You must be signed in to change notification settings - Fork 15
/
test_genius_bridge.py
79 lines (59 loc) · 1.89 KB
/
test_genius_bridge.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
from __future__ import annotations
import os
import pytest
from negmas import genius_bridge_is_running
from negmas.genius import GeniusBridge
DO_BRIDGE_OPS = os.environ.get("NEGMAS_TEST_BRIDBE_OPS", False)
@pytest.fixture(scope="module")
def init_genius():
GeniusBridge.start(0)
@pytest.mark.skipif(
condition=not DO_BRIDGE_OPS,
reason="No Genius Bridge, skipping genius-agent tests",
)
def test_genius_bridge_cleaning(init_genius):
GeniusBridge.clean()
@pytest.mark.skipif(
condition=not DO_BRIDGE_OPS,
reason="No Genius Bridge, skipping genius-agent tests",
)
def test_genius_bridge_shuttingdown(init_genius):
GeniusBridge.shutdown()
assert not genius_bridge_is_running()
@pytest.mark.skipif(
condition=not DO_BRIDGE_OPS,
reason="No Genius Bridge, skipping genius-agent tests",
)
def test_genius_bridge_killing_threads(init_genius):
GeniusBridge.kill_threads()
assert not genius_bridge_is_running()
@pytest.mark.skipif(
condition=not DO_BRIDGE_OPS,
reason="No Genius Bridge, skipping genius-agent tests",
)
def test_genius_bridge_killing_polietly(init_genius):
GeniusBridge.kill()
assert not genius_bridge_is_running()
@pytest.mark.skipif(
condition=not DO_BRIDGE_OPS,
reason="No Genius Bridge, skipping genius-agent tests",
)
def test_genius_bridge_killing_forcibly(init_genius):
GeniusBridge.kill_forced()
assert not genius_bridge_is_running()
@pytest.mark.skipif(
condition=not DO_BRIDGE_OPS,
reason="No Genius Bridge, skipping genius-agent tests",
)
def test_genius_bridge_starting():
port = GeniusBridge.start(-1)
assert port
assert genius_bridge_is_running(port)
@pytest.mark.skipif(
condition=not DO_BRIDGE_OPS,
reason="No Genius Bridge, skipping genius-agent tests",
)
def test_genius_bridge_restarting():
port = GeniusBridge.restart()
assert port
assert genius_bridge_is_running(port)