[ref] overlayのリファクタリングとテストを追加

This commit is contained in:
misyaguziya
2025-10-09 16:43:41 +09:00
parent c1cf78cda4
commit 569d8e3f76
5 changed files with 175 additions and 57 deletions

View File

@@ -0,0 +1,30 @@
import sys
import time
from PIL import Image
sys.path.append(r"d:\WORKSPACE\WORK\VRChatProject\VRCT\src-python")
from models.overlay import overlay_image, overlay_utils
def test_overlay_image_create():
oi = overlay_image.OverlayImage()
img = oi.createOverlayImageSmallLog("hello", "English", [], [])
assert isinstance(img, Image.Image)
def test_utils_transform():
import numpy as np
base = np.array([
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0]
])
res = overlay_utils.transform_matrix(base, (0, 0, 0), (0, 0, 0))
assert res.shape == (3, 4)
if __name__ == '__main__':
test_overlay_image_create()
test_utils_transform()
print('tests passed')