Skip to content

Commit 57d7b49

Browse files
committed
fix tests
1 parent 2014f09 commit 57d7b49

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

test/scenarios_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from warnet.k8s import delete_pod
99
from warnet.process import run_command
10-
from warnet.scenarios import _active as scenarios_active
10+
from warnet.status import _get_active_scenarios as scenarios_active
1111

1212

1313
class ScenariosTest(TestBase):
@@ -36,7 +36,7 @@ def scenario_running(self, scenario_name: str):
3636
"""Check that we are only running a single scenario of the correct name"""
3737
active = scenarios_active()
3838
assert len(active) == 1
39-
return scenario_name in active[0]["commander"]
39+
return scenario_name in active[0]["name"]
4040

4141
def run_and_check_scenario_from_file(self):
4242
scenario_file = "test/data/scenario_p2p_interface.py"
@@ -80,7 +80,7 @@ def stop_scenario(self):
8080
running = scenarios_active()
8181
assert len(running) == 1, f"Expected one running scenario, got {len(running)}"
8282
assert running[0]["status"] == "running", "Scenario should be running"
83-
delete_pod(running[0]["commander"])
83+
delete_pod(running[0]["name"])
8484
self.wait_for_predicate(self.check_scenario_stopped)
8585

8686
def check_scenario_stopped(self):

test/test_base.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from warnet.control import get_active_scenarios
1515
from warnet.k8s import get_pod_exit_status
1616
from warnet.network import _connected as network_connected
17-
from warnet.network import _status as network_status
17+
from warnet.status import _get_tank_status as network_status
1818

1919

2020
class TestBase:
@@ -112,11 +112,9 @@ def check_status():
112112
if len(tanks) == 0:
113113
return True
114114
for tank in tanks:
115-
for service in ["bitcoin", "lightning", "circuitbreaker"]:
116-
status = tank.get(f"{service}_status")
117-
if status:
118-
stats["total"] += 1
119-
stats[status] = stats.get(status, 0) + 1
115+
status = tank["status"]
116+
stats["total"] += 1
117+
stats[status] = stats.get(status, 0) + 1
120118
self.log.info(f"Waiting for all tanks to reach '{target}': {stats}")
121119
return target in stats and stats[target] == stats["total"]
122120

0 commit comments

Comments
 (0)