Commit 0489e4df authored by narugo1992's avatar narugo1992
Browse files

dev(narugo): another unittes

parent 08a0fd0c
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -70,9 +70,7 @@ class PillowResize:
        if isinstance(size, (list, tuple)) and len(size) not in (1, 2):
            raise ValueError("If size is a sequence, it should have 1 or 2 values")
        if max_size is not None and isinstance(size, (list, tuple)) and len(size) != 1:
            raise ValueError(
                "max_size is only supported for single int size or sequence of length 1"
            )
            raise ValueError("max_size is only supported for single int size or sequence of length 1")

        # noinspection PyTypeChecker
        self.size = size
+2 −0
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@ class TestPreprocessPillow:
            _ = PillowResize(size=())
        with pytest.raises(ValueError):
            _ = PillowResize(size=(1, 1, 4, 5, 1, 4))
        with pytest.raises(ValueError):
            _ = PillowResize(size=(224, 384), max_size=512)

    def test_resize_invalid_input(self):
        resize = PillowResize(size=640)