Skip to content

Commit 0ff1f8a

Browse files
committed
fixed more faiing tests
1 parent b6a9b1f commit 0ff1f8a

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

services/motion/motion_test.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ func TestPlan(t *testing.T) {
642642
input: &pb.Plan{
643643
Id: planID.String(),
644644
ExecutionId: executionID.String(),
645-
ComponentName: "",
645+
ComponentName: "component_name",
646646
Steps: []*pb.PlanStep{nil},
647647
},
648648
result: PlanWithMetadata{},
@@ -653,12 +653,12 @@ func TestPlan(t *testing.T) {
653653
input: &pb.Plan{
654654
Id: planID.String(),
655655
ExecutionId: executionID.String(),
656-
ComponentName: "",
656+
ComponentName: "component_name",
657657
},
658658
result: PlanWithMetadata{
659659
ID: planID,
660660
ExecutionID: executionID,
661-
ComponentName: "",
661+
ComponentName: "component_name",
662662
},
663663
},
664664
{
@@ -1398,9 +1398,12 @@ func TestPlanHistoryReq(t *testing.T) {
13981398
{
13991399
description: "empty struct returns an empty struct",
14001400
input: &pb.GetPlanRequest{
1401-
ComponentName: "",
1401+
ComponentName: "component_name",
1402+
},
1403+
result: PlanHistoryReq{
1404+
ComponentName: "component_name",
1405+
Extra: map[string]interface{}{},
14021406
},
1403-
result: PlanHistoryReq{Extra: map[string]interface{}{}},
14041407
},
14051408
{
14061409
description: "full struct returns a full struct",

services/motion/server_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ func TestServerMoveOnGlobe(t *testing.T) {
259259
test.That(t, *req.MotionCfg.ObstaclePollingFreqHz, test.ShouldAlmostEqual, obstaclePollingFrequencyHz)
260260
test.That(t, *req.MotionCfg.PositionPollingFreqHz, test.ShouldAlmostEqual, positionPollingFrequencyHz)
261261
test.That(t, len(req.MotionCfg.ObstacleDetectors), test.ShouldAlmostEqual, 2)
262-
test.That(t, req.MotionCfg.ObstacleDetectors[0].VisionServiceName, test.ShouldResemble, vision.Named("vision service 1"))
263-
test.That(t, req.MotionCfg.ObstacleDetectors[0].CameraName, test.ShouldResemble, camera.Named("camera 1"))
264-
test.That(t, req.MotionCfg.ObstacleDetectors[1].VisionServiceName, test.ShouldResemble, vision.Named("vision service 2"))
265-
test.That(t, req.MotionCfg.ObstacleDetectors[1].CameraName, test.ShouldResemble, camera.Named("camera 2"))
262+
test.That(t, req.MotionCfg.ObstacleDetectors[0].VisionServiceName, test.ShouldResemble, vision.Named("vision service 1").ShortName())
263+
test.That(t, req.MotionCfg.ObstacleDetectors[0].CameraName, test.ShouldResemble, camera.Named("camera 1").ShortName())
264+
test.That(t, req.MotionCfg.ObstacleDetectors[1].VisionServiceName, test.ShouldResemble, vision.Named("vision service 2").ShortName())
265+
test.That(t, req.MotionCfg.ObstacleDetectors[1].CameraName, test.ShouldResemble, camera.Named("camera 2").ShortName())
266266
test.That(t, len(req.BoundingRegions), test.ShouldEqual, 1)
267267
test.That(t, req.BoundingRegions[0], test.ShouldResemble, geoGeometry3)
268268
return firstExecutionID, nil
@@ -389,10 +389,10 @@ func TestServerMoveOnMap(t *testing.T) {
389389
test.That(t, *req.MotionCfg.ObstaclePollingFreqHz, test.ShouldAlmostEqual, obstaclePollingFrequencyHz)
390390
test.That(t, *req.MotionCfg.PositionPollingFreqHz, test.ShouldAlmostEqual, positionPollingFrequencyHz)
391391
test.That(t, len(req.MotionCfg.ObstacleDetectors), test.ShouldAlmostEqual, 2)
392-
test.That(t, req.MotionCfg.ObstacleDetectors[0].VisionServiceName, test.ShouldResemble, vision.Named("vision service 1"))
393-
test.That(t, req.MotionCfg.ObstacleDetectors[0].CameraName, test.ShouldResemble, camera.Named("camera 1"))
394-
test.That(t, req.MotionCfg.ObstacleDetectors[1].VisionServiceName, test.ShouldResemble, vision.Named("vision service 2"))
395-
test.That(t, req.MotionCfg.ObstacleDetectors[1].CameraName, test.ShouldResemble, camera.Named("camera 2"))
392+
test.That(t, req.MotionCfg.ObstacleDetectors[0].VisionServiceName, test.ShouldResemble, vision.Named("vision service 1").ShortName())
393+
test.That(t, req.MotionCfg.ObstacleDetectors[0].CameraName, test.ShouldResemble, camera.Named("camera 1").ShortName())
394+
test.That(t, req.MotionCfg.ObstacleDetectors[1].VisionServiceName, test.ShouldResemble, vision.Named("vision service 2").ShortName())
395+
test.That(t, req.MotionCfg.ObstacleDetectors[1].CameraName, test.ShouldResemble, camera.Named("camera 2").ShortName())
396396
return firstExecutionID, nil
397397
}
398398
moveOnMapResponse, err := server.MoveOnMap(context.Background(), moveOnMapRequest)

0 commit comments

Comments
 (0)