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
3 changes: 2 additions & 1 deletion src/viam/services/motion/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .client import MotionClient
from .client import MotionClient, MotionClient as MotionServiceClient

__all__ = [
"MotionClient",
"MotionServiceClient",
]
3 changes: 2 additions & 1 deletion src/viam/services/sensors/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .client import SensorsClient
from .client import SensorsClient, SensorsClient as SensorsServiceClient

__all__ = [
"SensorsClient",
"SensorsServiceClient",
]
3 changes: 2 additions & 1 deletion src/viam/services/vision/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from .client import Classification, Detection, VisionClient
from .client import Classification, Detection, VisionClient, VisionClient as VisionServiceClient

__all__ = [
"Classification",
"Detection",
"VisionClient",
"VisionServiceClient",
]
10 changes: 9 additions & 1 deletion tests/test_motion_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from viam.components.gantry import Gantry
from viam.proto.common import Pose, PoseInFrame
from viam.proto.service.motion import Constraints, LinearConstraint
from viam.services.motion import MotionClient
from viam.services.motion import MotionClient, MotionServiceClient

from . import loose_approx
from .mocks.services import MockMotion
Expand Down Expand Up @@ -80,3 +80,11 @@ async def test_do(self, service: MockMotion):
command = {"command": "args"}
response = await client.do_command(command)
assert response == command

@pytest.mark.asyncio
async def test_alias(self, service: MockMotion):
async with ChannelFor([service]) as channel:
client = MotionServiceClient(MOTION_SERVICE_NAME, channel)
command = {"command": "args"}
response = await client.do_command(command)
assert response == command
10 changes: 9 additions & 1 deletion tests/test_sensors_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from viam.proto.common import GeoPoint, Orientation, ResourceName, Vector3
from viam.proto.service.sensors import Readings
from viam.services.sensors import SensorsClient
from viam.services.sensors import SensorsClient, SensorsServiceClient
from viam.utils import primitive_to_value

from . import loose_approx
Expand Down Expand Up @@ -102,3 +102,11 @@ async def test_do(self, service: MockSensors):
command = {"command": "args"}
response = await client.do_command(command)
assert response == command

@pytest.mark.asyncio
async def test_alias(self, service: MockSensors):
async with ChannelFor([service]) as channel:
client = SensorsServiceClient(SENSOR_SERVICE_NAME, channel)
command = {"command": "args"}
response = await client.do_command(command)
assert response == command
9 changes: 9 additions & 0 deletions tests/test_vision_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
Detection,
Classification,
VisionClient,
VisionServiceClient,
)

from .mocks.services import MockVision
Expand Down Expand Up @@ -152,3 +153,11 @@ async def test_do(self, service: MockVision):
command = {"command": "args"}
response = await client.do_command(command)
assert response == command

@pytest.mark.asyncio
async def test_alias(self, service: MockVision):
async with ChannelFor([service]) as channel:
client = VisionServiceClient(VISION_SERVICE_NAME, channel)
command = {"command": "args"}
response = await client.do_command(command)
assert response == command