-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed CI error, add one more test just to check paths
- Loading branch information
Showing
3 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 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 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,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!" |