@@ -299,6 +299,11 @@ def test_conversion_writes_to_user_supplied_buffer(self):
299
299
target_format = PixelFormat .Bgr8
300
300
self .cam .set_pixel_format (record_format )
301
301
original_frame = self .cam .get_frame ()
302
+ self .assertEqual (original_frame .get_status (),
303
+ FrameStatus .Complete ,
304
+ 'Recorded frame was not complete. We cannot reliably work with a possibly '
305
+ 'empty frame because we want to check if pixel values are written '
306
+ 'correctly.' )
302
307
# Do conversion once without user supplied buffer. This creates a new VmbPy Frame with fresh
303
308
# buffer. We can then reuse that buffer for future conversions
304
309
np_buffer = original_frame .convert_pixel_format (target_format ).as_numpy_ndarray ()
@@ -317,6 +322,11 @@ def test_conversion_to_same_format_as_input(self):
317
322
record_format = PixelFormat .Mono8
318
323
self .cam .set_pixel_format (record_format )
319
324
original_frame = self .cam .get_frame ()
325
+ self .assertEqual (original_frame .get_status (),
326
+ FrameStatus .Complete ,
327
+ 'Recorded frame was not complete. We cannot reliably work with a possibly '
328
+ 'empty frame because we want to check if pixel values are written '
329
+ 'correctly.' )
320
330
# Do conversion once without user supplied buffer. This creates a new VmbPy Frame with fresh
321
331
# buffer. We can then reuse that buffer for future conversions
322
332
np_buffer = original_frame .convert_pixel_format (original_frame .get_pixel_format ()) \
@@ -342,6 +352,11 @@ def test_image_data_is_as_expected(self):
342
352
except ValueError :
343
353
self .skipTest (f'{ str (self .cam )} does not support pixel format "{ record_format } "' )
344
354
original_frame = self .cam .get_frame ()
355
+ self .assertEqual (original_frame .get_status (),
356
+ FrameStatus .Complete ,
357
+ 'Recorded frame was not complete. We cannot reliably work with a possibly '
358
+ 'empty frame because we want to check if pixel values are written '
359
+ 'correctly.' )
345
360
# Do conversion once without user supplied buffer. This creates a new VmbPy Frame with fresh
346
361
# buffer. We can then reuse that buffer for future conversions
347
362
np_buffer = original_frame .convert_pixel_format (target_format ).as_numpy_ndarray ()
@@ -364,6 +379,11 @@ def test_numpy_reports_shared_memory_for_user_buffer_and_new_ndarray(self):
364
379
target_format = PixelFormat .Bgr8
365
380
self .cam .set_pixel_format (record_format )
366
381
original_frame = self .cam .get_frame ()
382
+ self .assertEqual (original_frame .get_status (),
383
+ FrameStatus .Complete ,
384
+ 'Recorded frame was not complete. We cannot reliably work with a possibly '
385
+ 'empty frame because we want to check if pixel values are written '
386
+ 'correctly.' )
367
387
# Do conversion once without user supplied buffer. This creates a new VmbPy Frame with fresh
368
388
# buffer. We can then reuse that buffer for future conversions
369
389
np_buffer = original_frame .convert_pixel_format (target_format ).as_numpy_ndarray ()
0 commit comments