Skip to content

Commit 279007c

Browse files
committed
Fix tests
1 parent bcfe0e0 commit 279007c

File tree

9 files changed

+10
-11
lines changed

9 files changed

+10
-11
lines changed

src/arduino/app_internal/core/module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def parse_docker_compose_variable(variable_string) -> List[tuple[str, str]] | st
8888
8989
Args:
9090
variable_string: The string to parse (e.g., "${DATABASE_HOST:-db}",
91-
"${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-8086}:8086"), "${DATABASE_PASSWORD}".
91+
"${BIND_ADDRESS:-127.0.0.1}:8086:8086"), "${DATABASE_PASSWORD}".
9292
9393
Returns:
9494
A list of tuple containing the variable name and the default value (if present), or the original

src/arduino/app_tools/module_listing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def to_dict(self) -> dict:
8686
if self.require_container:
8787
var_to_add: List[ModuleVariable] = []
8888
for var in self.docker_compose_variables:
89-
if var.name != "APPSLAB_VERSION" and var.name != "DOCKER_REGISTRY_BASE" and var.name != "BIND_ADDRESS" and var.name != "BIND_PORT":
89+
if var.name != "APPSLAB_VERSION" and var.name != "DOCKER_REGISTRY_BASE" and var.name != "BIND_ADDRESS":
9090
var_to_add.append(var)
9191
vars_list: List[Dict] = [var.to_dict() for var in var_to_add]
9292
out_dict["variables"] = vars_list

tests/arduino/app_bricks/imageclassification/test_imageclassification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@pytest.fixture(autouse=True)
1111
def mock_dependencies(monkeypatch: pytest.MonkeyPatch):
1212
"""Mock out docker-compose lookups and image helpers."""
13-
fake_compose = {"services": {"models-runner": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-8100}:8100"]}}}
13+
fake_compose = {"services": {"models-runner": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:8100:8100"]}}}
1414
monkeypatch.setattr("arduino.app_internal.core.load_brick_compose_file", lambda cls: fake_compose)
1515
monkeypatch.setattr("arduino.app_internal.core.resolve_address", lambda host: "127.0.0.1")
1616
monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda x: [(None, None), (None, "8200")])

tests/arduino/app_bricks/keyword_spotter/test_keyword_spotter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@pytest.fixture(autouse=True)
1111
def mock_dependencies(monkeypatch: pytest.MonkeyPatch):
1212
"""Mock out docker-compose lookups and image helpers."""
13-
fake_compose = {"services": {"models-runner": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-8100}:8100"]}}}
13+
fake_compose = {"services": {"models-runner": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:8100:8100"]}}}
1414
monkeypatch.setattr("arduino.app_internal.core.load_brick_compose_file", lambda cls: fake_compose)
1515
monkeypatch.setattr("arduino.app_internal.core.resolve_address", lambda host: "127.0.0.1")
1616
monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda x: [(None, None), (None, "8200")])

tests/arduino/app_bricks/motion_detection/test_motion_detection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def app_instance(monkeypatch):
2424
@pytest.fixture(autouse=True)
2525
def mock_dependencies(monkeypatch: pytest.MonkeyPatch):
2626
"""Mock out docker-compose lookups and image helpers."""
27-
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-1337}:1337"]}}}
27+
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:1337:1337"]}}}
2828
monkeypatch.setattr("arduino.app_internal.core.ei.load_brick_compose_file", lambda cls: fake_compose)
2929
monkeypatch.setattr("arduino.app_internal.core.resolve_address", lambda host: "127.0.0.1")
3030
monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda x: [(None, None), (None, "1337")])

tests/arduino/app_bricks/objectdetection/test_objectdetection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def mock_dependencies(monkeypatch: pytest.MonkeyPatch):
2121
2222
This is needed to avoid network calls and other side effects.
2323
"""
24-
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-1337}:1337"]}}}
24+
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:1337:1337"]}}}
2525
monkeypatch.setattr("arduino.app_internal.core.ei.load_brick_compose_file", lambda cls: fake_compose)
2626
monkeypatch.setattr("arduino.app_internal.core.resolve_address", lambda host: "127.0.0.1")
2727
monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda x: [(None, None), (None, "1337")])

tests/arduino/app_bricks/vibration_anomaly_detection/test_vibration_anomaly_detection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def app_instance(monkeypatch):
2424
@pytest.fixture(autouse=True)
2525
def mock_dependencies(monkeypatch: pytest.MonkeyPatch):
2626
"""Mock out docker-compose lookups and image helpers."""
27-
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-1337}:1337"]}}}
27+
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:1337:1337"]}}}
2828
monkeypatch.setattr("arduino.app_internal.core.ei.load_brick_compose_file", lambda cls: fake_compose)
2929
monkeypatch.setattr("arduino.app_internal.core.resolve_address", lambda host: "127.0.0.1")
3030
monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda x: [(None, None), (None, "1337")])

tests/arduino/app_core/brick_compose_test_data.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# BIND_ADDRESS = external container address
2-
# BIND_PORT = container port
32
# DB_USERNAME = Edge Impulse project API key
43
# DB_PASSWORD = Database password
54
# INFLUXDB_ADMIN_TOKEN = InfluxDB admin token
65
services:
76
dbstorage-influx:
87
image: influxdb:2.7
98
ports:
10-
- "${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-8086}:8086"
9+
- "${BIND_ADDRESS:-127.0.0.1}:8086:8086"
1110
volumes:
1211
- "${APP_HOME:-.}/data/influx-data:/var/lib/influxdb2"
1312
environment:

tests/arduino/app_core/test_edge_impulse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def mock_infra(monkeypatch: pytest.MonkeyPatch):
1919
bytes unchanged.
2020
"""
2121
# avoid real docker-compose lookups
22-
fake = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-1337}:1337"]}}}
22+
fake = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:1337:1337"]}}}
2323
monkeypatch.setattr("arduino.app_internal.core.ei.load_brick_compose_file", lambda cls: fake)
2424
monkeypatch.setattr("arduino.app_internal.core.resolve_address", lambda h: "127.0.0.1")
2525
monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda s: [(None, None), (None, "1337")])
@@ -289,7 +289,7 @@ def fake_get(
289289
monkeypatch.setattr(HttpClient, "request_with_retry", fake_get)
290290

291291
# Mock docker-compose related functions
292-
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-1337}:1337"]}}}
292+
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:1337:1337"]}}}
293293
monkeypatch.setattr("arduino.app_internal.core.ei.load_brick_compose_file", lambda cls: fake_compose)
294294
monkeypatch.setattr("arduino.app_internal.core.resolve_address", lambda h: "127.0.0.1")
295295
monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda s: [(None, None), (None, "1337")])

0 commit comments

Comments
 (0)