Skip to content

Commit

Permalink
add check on camera initialization parameters on camera tests
Browse files Browse the repository at this point in the history
  • Loading branch information
odudex committed Sep 26, 2024
1 parent 2bbc533 commit 49c107d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ def test_init(mocker, m5stickv):
assert isinstance(c, Camera)


def test_initialize_sensors(mocker, m5stickv):
def test_initialize_sensors(mocker, multiple_devices):
import board
import krux
from krux.camera import Camera, OV7740_ID, OV2640_ID, GC0328_ID, GC2145_ID

Expand All @@ -30,6 +31,17 @@ def test_initialize_sensors(mocker, m5stickv):
if config_method:
getattr(c, config_method).assert_called()

if board.config["type"] == "cube" or c.cam_id == OV2640_ID:
krux.camera.sensor.set_vflip.assert_called_with(1)
else:
krux.camera.sensor.set_vflip.assert_not_called()
krux.camera.sensor.set_vflip.reset_mock()

if board.config["type"] == "cube":
krux.camera.sensor.set_hmirror.assert_called_with(1)
else:
krux.camera.sensor.set_hmirror.assert_not_called()

krux.camera.sensor.reset.assert_called()
krux.camera.sensor.set_pixformat.assert_called()
assert (
Expand Down

0 comments on commit 49c107d

Please sign in to comment.