@@ -157,11 +157,6 @@ func TestServerCaptureAllFromCamera(t *testing.T) {
157
157
test .That (t , len (getDetectionsResp .GetDetections ()), test .ShouldEqual , 1 )
158
158
test .That (t , getDetectionsResp .GetDetections ()[0 ].GetClassName (), test .ShouldEqual , "yes" )
159
159
160
- captureRequest := pb.CaptureAllFromCameraRequest {
161
- Name : testVisionServiceName ,
162
- ReturnDetections : true ,
163
- }
164
-
165
160
injectVS .CaptureAllFromCameraFunc = func (ctx context.Context ,
166
161
cameraName string ,
167
162
opts viscapture.CaptureOptions ,
@@ -170,12 +165,32 @@ func TestServerCaptureAllFromCamera(t *testing.T) {
170
165
det1 := objectdetection .NewDetection (image.Rectangle {}, 0.5 , "yes" )
171
166
return viscapture.VisCapture {
172
167
Detections : []objectdetection.Detection {det1 },
168
+ Extra : extra ,
173
169
}, nil
174
170
}
171
+
172
+ captureRequest := pb.CaptureAllFromCameraRequest {
173
+ Name : testVisionServiceName ,
174
+ ReturnDetections : true ,
175
+ Extra : ext ,
176
+ }
177
+
175
178
captAllResp , err := server .CaptureAllFromCamera (context .Background (), & captureRequest )
176
179
test .That (t , err , test .ShouldBeNil )
177
180
test .That (t , len (captAllResp .Detections ), test .ShouldEqual , 1 )
178
- test .That (t , getDetectionsResp .Detections [0 ].GetClassName (), test .ShouldEqual , "yes" )
181
+ test .That (t , captAllResp .Detections [0 ].GetClassName (), test .ShouldEqual , "yes" )
182
+ test .That (t , captAllResp .Extra .AsMap (), test .ShouldResemble , map [string ]interface {}{"foo" : "GetDetections" })
183
+
184
+ captureRequest = pb.CaptureAllFromCameraRequest {
185
+ Name : testVisionServiceName ,
186
+ ReturnDetections : true ,
187
+ Extra : nil ,
188
+ }
189
+ captAllResp , err = server .CaptureAllFromCamera (context .Background (), & captureRequest )
190
+ test .That (t , err , test .ShouldBeNil )
191
+ test .That (t , len (captAllResp .Detections ), test .ShouldEqual , 1 )
192
+ test .That (t , captAllResp .Detections [0 ].GetClassName (), test .ShouldEqual , "yes" )
193
+ test .That (t , len (captAllResp .Extra .AsMap ()), test .ShouldEqual , 0 )
179
194
180
195
test .ShouldResemble (captAllResp .Detections , getDetectionsResp .Detections )
181
196
}
0 commit comments