more stage tests
This commit is contained in:
parent
41b38f910a
commit
5b659a948a
|
@ -0,0 +1,23 @@
|
||||||
|
import unittest
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
|
from onnx_web.chain.blend_mask import BlendMaskStage
|
||||||
|
from onnx_web.params import HighresParams, UpscaleParams
|
||||||
|
|
||||||
|
|
||||||
|
class BlendMaskStageTests(unittest.TestCase):
|
||||||
|
def test_empty(self):
|
||||||
|
stage = BlendMaskStage()
|
||||||
|
sources = []
|
||||||
|
result = stage.run(
|
||||||
|
None,
|
||||||
|
None,
|
||||||
|
None,
|
||||||
|
None,
|
||||||
|
sources,
|
||||||
|
highres=HighresParams(False, 1, 0, 0),
|
||||||
|
upscale=UpscaleParams(""),
|
||||||
|
stage_mask=Image.new("RGBA", (64, 64)),
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(len(result), 0)
|
|
@ -0,0 +1,23 @@
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
from onnx_web.chain.reduce_crop import ReduceCropStage
|
||||||
|
from onnx_web.params import HighresParams, Size, UpscaleParams
|
||||||
|
|
||||||
|
|
||||||
|
class ReduceCropStageTests(unittest.TestCase):
|
||||||
|
def test_empty(self):
|
||||||
|
stage = ReduceCropStage()
|
||||||
|
sources = []
|
||||||
|
result = stage.run(
|
||||||
|
None,
|
||||||
|
None,
|
||||||
|
None,
|
||||||
|
None,
|
||||||
|
sources,
|
||||||
|
highres=HighresParams(False, 1, 0, 0),
|
||||||
|
upscale=UpscaleParams(""),
|
||||||
|
origin=Size(0, 0),
|
||||||
|
size=Size(128, 128),
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(len(result), 0)
|
Loading…
Reference in New Issue