Skip to content

Commit

Permalink
Fixed CI error, add one more test just to check paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuguangw committed Jul 25, 2023
1 parent 4f40f48 commit c9d1e10
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install package
run: |
sudo apt-get install -y libgl1-mesa-dev
pip install .[dev]
pip install -e .[dev]
- name: Pytest
run: |
pytest test
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ line-length = 120
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Assume Python 3.10.
target-version = "py310"
target-version = "py39"

[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
Expand All @@ -89,7 +89,7 @@ max-complexity = 10

[tool.black]
line-length = 88
target-version = ['py310']
target-version = ['py39']
include = '\.pyi?$'
# `extend-exclude` is not honored when `black` is passed a file path explicitly,
# as is typical when `black` is invoked via `pre-commit`.
Expand Down
21 changes: 21 additions & 0 deletions test/test_visualization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import cv2
import os

from zsos.utils.visualization import generate_text_image


def test_visualization():
width = 400
text = (
"This is a long text that needs to be drawn on an image with a specified "
"width. The text should wrap around if it exceeds the given width."
)

result_image = generate_text_image(width, text)

# Save the image to a file
output_filename = "build/output_image.png"
cv2.imwrite(output_filename, result_image)

# Assert that the file exists
assert os.path.exists(output_filename), "Output image file not found!"

0 comments on commit c9d1e10

Please sign in to comment.