-
Notifications
You must be signed in to change notification settings - Fork 78
Remove qr tests (New) #2397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Remove qr tests (New) #2397
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e180cfa
Removed support for qr code
fernando79513 f4d6525
Add opencv support for core20
fernando79513 be52089
Update rpi camera tests to include the device name
fernando79513 c2ee699
Added the quality test for raspis running core >=20
fernando79513 3d053fd
Removed after suspend flag and fixed wrong detect test
fernando79513 75215bd
moved rpi-detec test for easier reading
fernando79513 7455a18
Added the camera quality tests for core test-plan
fernando79513 015d4be
Potential fix for pull request finding
fernando79513 1d5cbd1
Updated rst file
fernando79513 94040de
Fixed wrong product slug field
fernando79513 83ffdb2
Using only the name to create the file
fernando79513 d64eedf
removed qr test from rst
fernando79513 2ed0767
Added pycamera tests
fernando79513 d5bfd92
Updated RST
fernando79513 776ffca
Small changes in rst
fernando79513 641fc42
Removed custom opencv build from core 22
fernando79513 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| #!/usr/bin/env python3 | ||
| # Copyright 2026 Canonical Ltd. | ||
| # | ||
| # This program is free software: you can redistribute it and/or modify | ||
| # it under the terms of the GNU General Public License version 3, | ||
| # as published by the Free Software Foundation. | ||
| # | ||
| # This program is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| import sys | ||
| import unittest | ||
| from unittest.mock import MagicMock, call, patch | ||
|
|
||
| sys.modules["picamera"] = MagicMock() | ||
| from camera_test_rpi import main, capture, test_res # noqa: E402 | ||
|
|
||
|
|
||
| class CameraTestRPITests(unittest.TestCase): | ||
| """Test cases for the camera_test_rpi module.""" | ||
|
|
||
| @patch("builtins.print", MagicMock()) | ||
| @patch("camera_test_rpi.time.sleep", MagicMock()) | ||
| @patch("camera_test_rpi.os.path") | ||
| @patch("camera_test_rpi.picamera.PiCamera") | ||
| def test_capture(self, mock_picamera, mock_path): | ||
| mock_path.expandvars.return_value = "/tmp/session" | ||
| mock_path.join.side_effect = [ | ||
| "/tmp/session/picam_{}_vchiq.jpg".format(i) | ||
| for i in range(1, len(test_res) + 2) | ||
| ] | ||
|
|
||
| capture("/dev/vchiq") | ||
|
|
||
| # Verify the camera calls | ||
| expected_picamera_calls = [ | ||
| call(resolution=res, framerate=fr) for res, fr in test_res | ||
| ] | ||
| self.assertEqual(mock_picamera.call_count, len(test_res)) | ||
| self.assertEqual(mock_picamera.call_args_list, expected_picamera_calls) | ||
|
|
||
| # Verify the capture calls | ||
| expected_capture_calls = [ | ||
| call("/tmp/session/picam_{}_{}.jpg".format(index, "vchiq")) | ||
| for index in range(1, len(test_res) + 1) | ||
| ] | ||
| camera = mock_picamera.return_value.__enter__.return_value | ||
| camera.capture.assert_has_calls(expected_capture_calls) | ||
|
|
||
| @patch("camera_test_rpi.capture") | ||
| def test_main_passes_device(self, mock_capture): | ||
| sys.argv = ["camera_test_rpi.py", "--device", "/dev/video0"] | ||
| main() | ||
| mock_capture.assert_called_once_with("/dev/video0") | ||
|
|
||
| @patch("camera_test_rpi.capture") | ||
| def test_main_default_device(self, mock_capture): | ||
| sys.argv = ["camera_test_rpi.py"] | ||
| main() | ||
| mock_capture.assert_called_once_with("/dev/vchiq") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.