@@ -175,19 +175,40 @@ async def main():
175175 await test .lua_send ("frame.sleep(0.05)" )
176176 await test .lua_equals ("frame.camera.image_ready()" , "true" )
177177
178- ## Capture in different modes
179- await test .lua_send ("frame.camera.capture{quality_factor=10}" )
180- await test .lua_send ("frame.sleep(0.1)" )
181- await test .lua_send ("frame.camera.capture{quality_factor=25}" )
182- await test .lua_send ("frame.sleep(0.1)" )
183- await test .lua_send ("frame.camera.capture{quality_factor=50}" )
184- await test .lua_send ("frame.sleep(0.1)" )
185- await test .lua_send ("frame.camera.capture{quality_factor=100}" )
186- await test .lua_send ("frame.sleep(0.1)" )
187- await test .lua_error ("frame.camera.capture{quality_factor=75}" )
178+ ## Capture in different resolutions
179+ await test .lua_send ("frame.camera.capture { resolution = 100 }" )
180+ await test .lua_send ("frame.camera.capture { resolution = 256 }" )
181+ await test .lua_send ("frame.camera.capture { resolution = 512 }" )
182+ await test .lua_send ("frame.camera.capture { resolution = 720 }" )
183+
184+ await test .lua_error ("frame.camera.capture { resolution = 80 }" )
185+ await test .lua_error ("frame.camera.capture { resolution = 513 }" )
186+ await test .lua_error ("frame.camera.capture { resolution = 721 }" )
187+
188+ ## Capture in different quality
189+ await test .lua_send ("frame.camera.capture { quality = 'VERY_HIGH' }" )
190+ await test .lua_send ("frame.camera.capture { quality = 'HIGH' }" )
191+ await test .lua_send ("frame.camera.capture { quality = 'MEDIUM' }" )
192+ await test .lua_send ("frame.camera.capture { quality = 'LOW' }" )
193+ await test .lua_send ("frame.camera.capture { quality = 'VERY_LOW' }" )
194+
195+ await test .lua_error ("frame.camera.capture { quality = 50 }" )
196+ await test .lua_error ("frame.camera.capture { quality = 'BAD' }" )
197+
198+ ## Capture with different pan amounts
199+ await test .lua_send ("frame.camera.capture { pan = -140 }" )
200+ await test .lua_send ("frame.camera.capture { pan = -75 }" )
201+ await test .lua_send ("frame.camera.capture { pan = 0 }" )
202+ await test .lua_send ("frame.camera.capture { pan = 75 }" )
203+ await test .lua_send ("frame.camera.capture { pan = 140 }" )
204+
205+ await test .lua_error ("frame.camera.capture { pan = -141 }" )
206+ await test .lua_error ("frame.camera.capture { pan = 200 }" )
188207
189208 ## Read
209+ await test .lua_send ("frame.sleep(0.1)" )
190210 await test .lua_equals ("#frame.camera.read(123)" , "123" )
211+ await test .lua_equals ("#frame.camera.read_raw(54)" , "54" )
191212
192213 ## Test sleep prevents captures
193214 await test .lua_send ("frame.camera.power_save(true)" )
@@ -196,9 +217,6 @@ async def main():
196217 await test .lua_send ("frame.sleep(0.1)" )
197218 await test .lua_send ("frame.camera.capture{}" )
198219
199- ## Zoom & pan
200- # TODO
201-
202220 ## Manual exposure & gain
203221 # TODO
204222
0 commit comments