fix: 任务错误提示改为顶部居中 (#87)

This commit is contained in:
chengma
2026-08-10 10:05:45 +08:00
parent 663c5ee666
commit bf816bce02
3 changed files with 10 additions and 6 deletions
+4
View File
@@ -11,6 +11,7 @@ from unittest.mock import patch
os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
from PyQt5.QtWidgets import QApplication
from qfluentwidgets import InfoBarPosition
from src.android_device_service import AndroidDeviceSearchError
from src.pdd_ui import PDDTaskPage
@@ -468,6 +469,7 @@ class PDDTaskPageEventTest(unittest.TestCase):
events._show_rerun_error("重新采集失败", "测试错误")
second = events._rerun_feedback
self.assertIsNot(first, second)
self.assertEqual(second.position, InfoBarPosition.TOP)
self.assertEqual(second.duration, ERROR_FEEDBACK_DURATION_MS)
close_buttons = [
@@ -502,6 +504,7 @@ class PDDTaskPageEventTest(unittest.TestCase):
second = events._claim_feedback
self.assertIsNot(first, second)
self.assertEqual(second.position, InfoBarPosition.TOP)
self.assertEqual(second.duration, ERROR_FEEDBACK_DURATION_MS)
self.assertGreaterEqual(second.minimumWidth(), ERROR_FEEDBACK_MIN_WIDTH)
self.assertGreaterEqual(second.minimumHeight(), ERROR_FEEDBACK_MIN_HEIGHT)
@@ -616,6 +619,7 @@ class PDDTaskPageEventTest(unittest.TestCase):
events._show_device_unavailable("第二条")
second = events._device_feedback
self.assertIsNot(first, second)
self.assertEqual(second.position, InfoBarPosition.TOP)
self.assertEqual(second.duration, ERROR_FEEDBACK_DURATION_MS)
self.assertGreaterEqual(second.minimumWidth(), ERROR_FEEDBACK_MIN_WIDTH)
self.assertGreaterEqual(second.minimumHeight(), ERROR_FEEDBACK_MIN_HEIGHT)