Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dimos/hardware/whole_body/damiao/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def test_make_can_bus_linux_uses_ordered_defaults(
dual_robot: FakeRobot,
mocker: MockerFixture,
) -> None:
socketcan = mocker.patch.object(can_motor_control, "SocketCanBus")
socketcan = mocker.patch.object(can_motor_control, "SocketCanBus", create=True)
mocker.patch.object(adapter_module.sys, "platform", "linux")
adapter = DualAdapter(dual_robot)

Expand All @@ -343,7 +343,7 @@ def test_make_can_bus_linux_uses_configured_interface(
dual_robot: FakeRobot,
mocker: MockerFixture,
) -> None:
socketcan = mocker.patch.object(can_motor_control, "SocketCanBus")
socketcan = mocker.patch.object(can_motor_control, "SocketCanBus", create=True)
mocker.patch.object(adapter_module.sys, "platform", "linux")
adapter = DualAdapter(
dual_robot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import pytest
from pytest_mock import MockerFixture

from dimos.hardware.whole_body.damiao import adapter as adapter_module
from dimos.hardware.whole_body.damiao.config import DamiaoRuntimeConfig
from dimos.hardware.whole_body.dual_openyam_damiao.adapter import (
DualOpenYamDamiaoAdapter,
Expand All @@ -29,7 +30,12 @@

@pytest.fixture
def adapter(mocker: MockerFixture) -> Iterator[DualOpenYamDamiaoAdapter]:
mocker.patch.object(can_motor_control, "SocketCanBus", can_motor_control.MockCanBus)
# Darwin wheels of can_motor_control omit SocketCanBus (SocketCAN is
# Linux-only), so create the attribute and force the Linux bus path.
mocker.patch.object(
can_motor_control, "SocketCanBus", can_motor_control.MockCanBus, create=True
)
mocker.patch.object(adapter_module.sys, "platform", "linux")
result = DualOpenYamDamiaoAdapter(
runtime_config=DamiaoRuntimeConfig(
bus_devices={"left": "can8", "right": "can9"},
Expand Down
8 changes: 7 additions & 1 deletion dimos/hardware/whole_body/openarm_damiao/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import pytest
from pytest_mock import MockerFixture

from dimos.hardware.whole_body.damiao import adapter as damiao_adapter_module
from dimos.hardware.whole_body.damiao.adapter import DamiaoWholeBodyAdapter
from dimos.hardware.whole_body.damiao.config import DamiaoRuntimeConfig
from dimos.hardware.whole_body.openarm_damiao import adapter as adapter_module
Expand All @@ -30,7 +31,12 @@

@pytest.fixture
def openarm_adapter(mocker: MockerFixture) -> Iterator[OpenArmDamiaoAdapter]:
mocker.patch.object(can_motor_control, "SocketCanBus", can_motor_control.MockCanBus)
# Darwin wheels of can_motor_control omit SocketCanBus (SocketCAN is
# Linux-only), so create the attribute and force the Linux bus path.
mocker.patch.object(
can_motor_control, "SocketCanBus", can_motor_control.MockCanBus, create=True
)
mocker.patch.object(damiao_adapter_module.sys, "platform", "linux")
adapter = OpenArmDamiaoAdapter(
runtime_config=DamiaoRuntimeConfig(gravity_comp=False),
)
Expand Down
Loading