Skip to content

Commit a30127e

Browse files
committed
fix: align compose network name in tests
1 parent c85233a commit a30127e

3 files changed

Lines changed: 9 additions & 18 deletions

File tree

concore_cli/commands/build.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,10 @@ def _write_docker_compose(output_path, console, zmq_mode=False):
7979
run_script = output_path / "run"
8080
if not run_script.exists():
8181
console.print(
82-
"[yellow]Warning:[/yellow] No docker run script found "
83-
f"in {output_path}."
82+
f"[yellow]Warning:[/yellow] No docker run script found in {output_path}."
8483
)
8584
console.print(
86-
"[dim]Tip: run concore build --type docker first, "
87-
"then use --compose[/dim]"
85+
"[dim]Tip: run concore build --type docker first, then use --compose[/dim]"
8886
)
8987
return None
9088

tests/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@ def test_build_command_docker_compose_single_node(self):
384384
self.assertIn("container_name: 'N1'", compose_content)
385385
self.assertIn("image: 'docker-script'", compose_content)
386386
self.assertIn("networks:", compose_content)
387-
self.assertIn("concore-net:", compose_content)
388-
self.assertIn("- concore-net", compose_content)
387+
self.assertIn("concore_net:", compose_content)
388+
self.assertIn("- concore_net", compose_content)
389389
self.assertIn("restart: on-failure", compose_content)
390390

391391
metadata = json.loads(Path("out/STUDY.json").read_text())

tests/test_compose_generation.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,22 @@ def test_compose_first_service_has_no_depends_on(tmp_path):
5151
)
5252
path = _write_docker_compose(tmp_path, Console(quiet=True))
5353
lines = path.read_text().splitlines()
54-
controller_idx = next(
55-
i for i, line in enumerate(lines) if "controller:" in line
56-
)
57-
plant_idx = next(
58-
i for i, line in enumerate(lines) if "plant:" in line
59-
)
54+
controller_idx = next(i for i, line in enumerate(lines) if "controller:" in line)
55+
plant_idx = next(i for i, line in enumerate(lines) if "plant:" in line)
6056
section = lines[controller_idx:plant_idx]
6157
assert not any("depends_on" in line for line in section)
6258

6359

6460
def test_zmq_mode_adds_env(tmp_path):
6561
_fake_run_script(tmp_path, [{"name": "node1", "image": "concore/py"}])
66-
path = _write_docker_compose(
67-
tmp_path, Console(quiet=True), zmq_mode=True
68-
)
62+
path = _write_docker_compose(tmp_path, Console(quiet=True), zmq_mode=True)
6963
content = path.read_text()
7064
assert "CONCORE_TRANSPORT=zmq" in content
7165

7266

7367
def test_no_zmq_env_in_default_mode(tmp_path):
7468
_fake_run_script(tmp_path, [{"name": "node1", "image": "concore/py"}])
75-
path = _write_docker_compose(
76-
tmp_path, Console(quiet=True), zmq_mode=False
77-
)
69+
path = _write_docker_compose(tmp_path, Console(quiet=True), zmq_mode=False)
7870
content = path.read_text()
7971
assert "CONCORE_TRANSPORT" not in content
8072

@@ -87,6 +79,7 @@ def test_missing_run_script_returns_none(tmp_path):
8779
def test_zmq_without_compose_errors():
8880
from click.testing import CliRunner
8981
from concore_cli.cli import cli
82+
9083
runner = CliRunner()
9184
result = runner.invoke(cli, ["build", "wf.graphml", "--zmq"])
9285
assert result.exit_code != 0

0 commit comments

Comments
 (0)