Skip to content

Commit

Permalink
Add tests for opencv python
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk committed Nov 2, 2024
1 parent e181b00 commit 71acda4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
shell: bash
run: |
python -m pip install --upgrade pip
pip install -U jupyter_packaging pytest simplejpeg pillow
pip install -U jupyter_packaging pytest simplejpeg pillow opencv-python-headless
pip install .
rm -rf ./jupyter_rfb ./build ./egg-info
- name: Test with pytest
Expand Down
8 changes: 8 additions & 0 deletions tests/test_jpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
select_encoder,
SimpleJpegEncoder,
PillowJpegEncoder,
OpenCVJpegEncoder,
)


Expand Down Expand Up @@ -40,6 +41,13 @@ def test_pillow_jpeg_encoder():
_perform_error_checks(encoder)


def test_opencv_jpeg_encoder():
"""Test the opencv encoder."""
encoder = OpenCVJpegEncoder()
_perform_checks(encoder)
_perform_error_checks(encoder)


def _perform_checks(encoder):
# RGB
im = get_random_im(100, 100, 3)
Expand Down

0 comments on commit 71acda4

Please sign in to comment.