更新bug
This commit is contained in:
@@ -1,20 +1,36 @@
|
||||
import time
|
||||
import pyautogui
|
||||
import pyperclip
|
||||
"""手工剪贴板联调;自动测试导入本模块时不会点击桌面。"""
|
||||
|
||||
print("Please open WeCom chat window and keep it active.")
|
||||
time.sleep(3)
|
||||
old = pyperclip.paste()
|
||||
print(f"Old clipboard: {old}")
|
||||
import unittest
|
||||
|
||||
# Click in the center of the active window
|
||||
pyautogui.click()
|
||||
time.sleep(0.2)
|
||||
pyautogui.hotkey('ctrl', 'a')
|
||||
time.sleep(0.2)
|
||||
pyautogui.hotkey('ctrl', 'c')
|
||||
time.sleep(0.5)
|
||||
new = pyperclip.paste()
|
||||
|
||||
print(f"New clipboard length: {len(new)}")
|
||||
print(f"New clipboard snippet: {new[:100]}")
|
||||
def main() -> None:
|
||||
import time
|
||||
|
||||
import pyautogui
|
||||
import pyperclip
|
||||
|
||||
print("Please open WeCom chat window and keep it active.")
|
||||
time.sleep(3)
|
||||
old = pyperclip.paste()
|
||||
print(f"Old clipboard: {old}")
|
||||
|
||||
# Click in the center of the active window.
|
||||
pyautogui.click()
|
||||
time.sleep(0.2)
|
||||
pyautogui.hotkey("ctrl", "a")
|
||||
time.sleep(0.2)
|
||||
pyautogui.hotkey("ctrl", "c")
|
||||
time.sleep(0.5)
|
||||
new = pyperclip.paste()
|
||||
|
||||
print(f"New clipboard length: {len(new)}")
|
||||
print(f"New clipboard snippet: {new[:100]}")
|
||||
|
||||
|
||||
class ManualClipboardIsolationTest(unittest.TestCase):
|
||||
def test_manual_entrypoint_is_import_safe(self) -> None:
|
||||
self.assertTrue(callable(main))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user