fix(ci): 修复ruff全量检查错误 - test_clip_operations.py
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
from dataclasses import dataclass
|
||||
from dataclasses import FrozenInstanceError, dataclass
|
||||
|
||||
from packages.domain.clip_operations import (
|
||||
ROUND_PRECISION,
|
||||
@@ -166,7 +166,7 @@ class TestCalculateSplit(unittest.TestCase):
|
||||
def test_frozen_result(self):
|
||||
"""SplitResult 是 frozen dataclass。"""
|
||||
result = calculate_split(duration=5.0, split_time=2.0)
|
||||
with self.assertRaises(Exception):
|
||||
with self.assertRaises(FrozenInstanceError):
|
||||
result.left_duration = 3.0 # type: ignore[misc]
|
||||
|
||||
|
||||
@@ -410,7 +410,7 @@ class TestCalculateMerge(unittest.TestCase):
|
||||
_MockClip(id="c2", order=1, duration=3.0),
|
||||
]
|
||||
result = calculate_merge(clips)
|
||||
with self.assertRaises(Exception):
|
||||
with self.assertRaises(FrozenInstanceError):
|
||||
result.total_duration = 10.0 # type: ignore[misc]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user