# Path: pyuploadcare/transformations/video.py
# class Quality(StrEnum):
#     normal = "normal"
#     better = "better"
#     best = "best"
#     lighter = "lighter"
#     lightest = "lightest"
# 
# class ResizeMode(StrEnum):
#     preserve_ratio = "preserve_ratio"
#     change_ratio = "change_ratio"
#     scale_crop = "scale_crop"
#     add_padding = "add_padding"
# 
# class VideoFormat(StrEnum):
#     webm = "webm"
#     ogg = "ogg"
#     mp4 = "mp4"
# 
# class VideoTransformation(BaseTransformation):
#     def format(
#         self, file_format: Union[VideoFormat, str]
#     ) -> "VideoTransformation":
#         self.set("format", [file_format])
#         return self
# 
#     def size(
#         self,
#         width: Optional[int] = None,
#         height: Optional[int] = None,
#         resize_mode: Optional[Union[str, ResizeMode]] = None,
#     ) -> "VideoTransformation":
#         parameters = [f'{width or ""}x{height or ""}']
#         if resize_mode:
#             parameters.append(resize_mode)
#         self.set("size", parameters)
#         return self
# 
#     def quality(self, file_quality: Quality) -> "VideoTransformation":
#         self.set("quality", [file_quality])
#         return self
# 
#     def cut(self, start_time: str, length: str) -> "VideoTransformation":
#         self.set("cut", [start_time, length])
#         return self
# 
#     def thumbs(self, amount: int) -> "VideoTransformation":
#         self.set("thumbs", [str(amount)])
#         return self
# 
#     def _prefix(self, file_id: str) -> str:
#         return f"{file_id}/video/"
# 
#     def path(self, file_id: str) -> str:
#         path_ = super().path(file_id)
#         path_ = path_.replace("thumbs/", "thumbs~")
#         return path_


from pyuploadcare.transformations.video import (
    Quality,
    ResizeMode,
    VideoFormat,
    VideoTransformation,
)
        .quality(Quality.lighter)
        .cut(start_time="2:30.535", length="2:20.0")
        .thumbs(10)
    )

    assert transformation.path("a6efd840-076f-4227-9073-bbaef16cfe35") == (
        "a6efd840-076f-4227-9073-bbaef16cfe35/video/-/format/mp4/"
        "-/size/640x480/add_padding/-/quality/lighter/"
        "-/cut/2:30.535/2:20.0/-/thumbs~10/"
    )


def test_video_transformation_order_matters():
    transformation = (
        VideoTransformation()
        .size(width=640, height=480, resize_mode=ResizeMode.add_padding)
        .quality(Quality.lighter)
        .cut(start_time="2:30.535", length="2:20.0")
        .format(VideoFormat.mp4)
        .thumbs(10)
    )

    assert transformation.path("a6efd840-076f-4227-9073-bbaef16cfe35") == (
        "a6efd840-076f-4227-9073-bbaef16cfe35/video/"
        "-/size/640x480/add_padding/-/quality/lighter/"
        "-/cut/2:30.535/2:20.0/-/format/mp4/-/thumbs~10/"
    )


def test_video_transformation_custom_without_parameters():

# Path: pyuploadcare/transformations/video.py
# class Quality(StrEnum):
#     normal = "normal"
#     better = "better"
#     best = "best"
#     lighter = "lighter"
#     lightest = "lightest"
# 
# class ResizeMode(StrEnum):
#     preserve_ratio = "preserve_ratio"
#     change_ratio = "change_ratio"
#     scale_crop = "scale_crop"
#     add_padding = "add_padding"
# 
# class VideoFormat(StrEnum):
#     webm = "webm"
#     ogg = "ogg"
#     mp4 = "mp4"
# 
# class VideoTransformation(BaseTransformation):
#     def format(
#         self, file_format: Union[VideoFormat, str]
#     ) -> "VideoTransformation":
#         self.set("format", [file_format])
#         return self
# 
#     def size(
#         self,
#         width: Optional[int] = None,
#         height: Optional[int] = None,
#         resize_mode: Optional[Union[str, ResizeMode]] = None,
#     ) -> "VideoTransformation":
#         parameters = [f'{width or ""}x{height or ""}']
#         if resize_mode:
#             parameters.append(resize_mode)
#         self.set("size", parameters)
#         return self
# 
#     def quality(self, file_quality: Quality) -> "VideoTransformation":
#         self.set("quality", [file_quality])
#         return self
# 
#     def cut(self, start_time: str, length: str) -> "VideoTransformation":
#         self.set("cut", [start_time, length])
#         return self
# 
#     def thumbs(self, amount: int) -> "VideoTransformation":
#         self.set("thumbs", [str(amount)])
#         return self
# 
#     def _prefix(self, file_id: str) -> str:
#         return f"{file_id}/video/"
# 
#     def path(self, file_id: str) -> str:
#         path_ = super().path(file_id)
#         path_ = path_.replace("thumbs/", "thumbs~")
#         return path_


# Path: tests/functional/transformations/test_video.py
from pyuploadcare.transformations.video import (
    Quality,
    ResizeMode,
    VideoFormat,
    VideoTransformation,
)

        .quality(Quality.lighter)
        .cut(start_time="2:30.535", length="2:20.0")
        .thumbs(10)
    )

    assert transformation.path("a6efd840-076f-4227-9073-bbaef16cfe35") == (
        "a6efd840-076f-4227-9073-bbaef16cfe35/video/-/format/mp4/"
        "-/size/640x480/add_padding/-/quality/lighter/"
        "-/cut/2:30.535/2:20.0/-/thumbs~10/"
    )


def test_video_transformation_order_matters():
    transformation = (
        VideoTransformation()
        .size(width=640, height=480, resize_mode=ResizeMode.add_padding)
        .quality(Quality.lighter)
        .cut(start_time="2:30.535", length="2:20.0")
        .format(VideoFormat.mp4)
        .thumbs(10)
    )

    assert transformation.path("a6efd840-076f-4227-9073-bbaef16cfe35") == (
        "a6efd840-076f-4227-9073-bbaef16cfe35/video/"
        "-/size/640x480/add_padding/-/quality/lighter/"
        "-/cut/2:30.535/2:20.0/-/format/mp4/-/thumbs~10/"
    )


def test_video_transformation_custom_without_parameters():

    transformation = VideoTransformation().set("custom", []).thumbs(10)