lycheedev 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +49 -0
- package/README.md +45 -0
- package/THIRD_PARTY_NOTICES +812 -0
- package/bin/lycheedev.mjs +56 -0
- package/native/windows-amd64/lycheedev.exe +0 -0
- package/package.json +12 -33
- package/payload/addon/Bridge/CaptureWriter.lua +154 -0
- package/payload/addon/Bridge/Definitions.lua +3 -0
- package/payload/addon/Bridge/Identity.lua +127 -0
- package/{vendor/addon/Libs/AutomationQR.lua → payload/addon/Bridge/MatrixSymbol.lua} +23 -30
- package/payload/addon/Bridge/ProbeQueue.lua +136 -0
- package/payload/addon/Bridge/ProbeRunner.lua +128 -0
- package/payload/addon/Bridge/ReceiptView.lua +160 -0
- package/payload/addon/Bridge/Reentry.lua +192 -0
- package/payload/addon/Bridge/ReportStore.lua +153 -0
- package/payload/addon/Bridge/Session.lua +163 -0
- package/payload/addon/Clients/Evergreen.lua +2 -0
- package/payload/addon/Clients/Live.lua +2 -0
- package/payload/addon/Clients/Pandaria.lua +2 -0
- package/payload/addon/Clients/Titan.lua +2 -0
- package/payload/addon/Core/Compat.lua +59 -0
- package/payload/addon/Core/Controls.lua +168 -0
- package/{vendor/addon/Core/Bootstrap.lua → payload/addon/Core/Execute.lua} +12 -23
- package/{vendor → payload}/addon/Core/Inspector.lua +19 -235
- package/{vendor → payload}/addon/Core/Locale.lua +128 -93
- package/{vendor → payload}/addon/Core/Locale_enUS.lua +128 -95
- package/payload/addon/Core/Persistence.lua +58 -0
- package/payload/addon/Core/Platform.lua +58 -0
- package/payload/addon/Core/Runtime.lua +25 -0
- package/payload/addon/Core/Safety.lua +56 -0
- package/{vendor → payload}/addon/Core/Serializer.lua +18 -6
- package/payload/addon/Core/Stores.lua +611 -0
- package/payload/addon/Lychee Dev_Forever.toc +52 -0
- package/payload/addon/Lychee Dev_Mainline.toc +52 -0
- package/payload/addon/Lychee Dev_Mists.toc +52 -0
- package/payload/addon/Lychee Dev_Wrath.toc +52 -0
- package/payload/addon/Modules/AutomationView.lua +393 -0
- package/{vendor → payload}/addon/Modules/Diagnostics.lua +92 -36
- package/{vendor → payload}/addon/Modules/Events/Catalog.lua +9 -0
- package/{vendor → payload}/addon/Modules/Events/Monitor.lua +45 -5
- package/payload/addon/Modules/FunctionTrace.lua +150 -0
- package/{vendor → payload}/addon/Modules/ObjectInspector.lua +105 -31
- package/{vendor → payload}/addon/UI/Export.lua +64 -34
- package/{vendor → payload}/addon/UI/Pages/About.lua +26 -14
- package/payload/addon/UI/Pages/Automation.lua +446 -0
- package/payload/addon/UI/Pages/Diagnostics.lua +402 -0
- package/{vendor/addon/UI/Features.lua → payload/addon/UI/Pages/Events.lua} +192 -302
- package/{vendor → payload}/addon/UI/Pages/ExportRecords.lua +213 -132
- package/{vendor → payload}/addon/UI/Pages/Object.lua +229 -121
- package/payload/addon/UI/Pages/Run.lua +423 -0
- package/payload/addon/UI/Pages/Trace.lua +314 -0
- package/payload/addon/UI/TreeView.lua +246 -0
- package/{vendor/addon/UI/MainWindow.lua → payload/addon/UI/Widgets.lua} +89 -529
- package/payload/addon/UI/Window.lua +425 -0
- package/payload/skill/SKILL.md +87 -0
- package/payload/skill/agents/openai.yaml +7 -0
- package/payload/skill/references/addon-validation.md +42 -0
- package/payload/skill/references/asset-export.md +109 -0
- package/payload/skill/references/commands.md +169 -0
- package/payload/skill/references/data-investigation.md +242 -0
- package/payload/skill/references/error-diagnosis.md +41 -0
- package/payload/skill/references/installation.md +18 -0
- package/payload/skill/references/live-investigation.md +129 -0
- package/payload/skill/references/source-research.md +82 -0
- package/payload/skill/scripts/lycheedev.mjs +59 -0
- package/release.json +346 -0
- package/bin/lycheedev.js +0 -746
- package/src/addon.js +0 -95
- package/src/config.js +0 -68
- package/src/doctor.js +0 -126
- package/src/install.js +0 -145
- package/src/paths.js +0 -93
- package/src/py/instances.py +0 -165
- package/src/python.js +0 -111
- package/src/skill.js +0 -48
- package/src/wow.js +0 -541
- package/vendor/addon/Core/Clients/Forever.lua +0 -9
- package/vendor/addon/Core/Clients/Mainline.lua +0 -9
- package/vendor/addon/Core/Clients/Mists.lua +0 -9
- package/vendor/addon/Core/Clients/Titan.lua +0 -9
- package/vendor/addon/Core/Compatibility.lua +0 -43
- package/vendor/addon/Core/Database.lua +0 -859
- package/vendor/addon/Core/Safety.lua +0 -42
- package/vendor/addon/Lychee Dev_Forever.toc +0 -44
- package/vendor/addon/Lychee Dev_Mainline.toc +0 -44
- package/vendor/addon/Lychee Dev_Mists.toc +0 -44
- package/vendor/addon/Lychee Dev_Wrath.toc +0 -44
- package/vendor/addon/Modules/Automation/Controller.lua +0 -896
- package/vendor/addon/Modules/Automation/Reload.lua +0 -101
- package/vendor/addon/Modules/Automation/Report.lua +0 -409
- package/vendor/addon/Modules/Automation/auto/auto.lua +0 -12
- package/vendor/addon/Modules/FunctionTrace.lua +0 -85
- package/vendor/addon/UI/AutomationOverlay.lua +0 -253
- package/vendor/addon/UI/Pages/Automation.lua +0 -417
- package/vendor/addon/UI/Pages/Diagnostics.lua +0 -289
- package/vendor/addon/UI/Pages/Trace.lua +0 -165
- package/vendor/skill/SKILL.md +0 -44
- package/vendor/skill/agents/openai.yaml +0 -4
- package/vendor/skill/references/automation.md +0 -130
- package/vendor/skill/references/clients.md +0 -51
- package/vendor/skill/references/runtime-investigations.md +0 -104
- package/vendor/skill/scripts/automation/__init__.py +0 -1
- package/vendor/skill/scripts/automation/registry.py +0 -516
- package/vendor/skill/scripts/automation/reload.py +0 -121
- package/vendor/skill/scripts/automation/saved_variables.py +0 -438
- package/vendor/skill/scripts/automation/session.py +0 -207
- package/vendor/skill/scripts/automation/windows.py +0 -792
- package/vendor/skill/scripts/automation.py +0 -1067
- package/vendor/skill/scripts/requirements.txt +0 -13
- package/vendor/skill/scripts/selftest_offline.py +0 -1061
- package/vendor/skill/scripts/test_input_safety.py +0 -132
- package/vendor/skill/scripts/test_reload.py +0 -120
- /package/{vendor → payload}/addon/Media/GitHub.png +0 -0
- /package/{vendor → payload}/addon/Media/Logo.png +0 -0
- /package/{vendor → payload}/addon/Modules/Events/CatalogData_Forever.lua +0 -0
- /package/{vendor → payload}/addon/Modules/Events/CatalogData_Mainline.lua +0 -0
- /package/{vendor → payload}/addon/Modules/Events/CatalogData_Mists.lua +0 -0
- /package/{vendor → payload}/addon/Modules/Events/CatalogData_Titan.lua +0 -0
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"""Offline input regression: all window, keyboard and clipboard calls are mocked."""
|
|
2
|
-
import unittest
|
|
3
|
-
from unittest.mock import patch
|
|
4
|
-
from automation import windows
|
|
5
|
-
|
|
6
|
-
class Clipboard:
|
|
7
|
-
def __init__(self): self.text = "previous clipboard"
|
|
8
|
-
def read_text(self): return self.text
|
|
9
|
-
def copy_text(self, value): self.text = value
|
|
10
|
-
def clear(self): self.text = None
|
|
11
|
-
|
|
12
|
-
class InputSafetyTests(unittest.TestCase):
|
|
13
|
-
def test_windows_path_aliases_match(self):
|
|
14
|
-
identity = windows.WindowIdentity(1, 2, r"D:\Game\Wow.exe", "test")
|
|
15
|
-
self.assertTrue(identity.matches(pid=2, exe_path="d:/game/WOW.EXE"))
|
|
16
|
-
self.assertFalse(identity.matches(pid=3))
|
|
17
|
-
|
|
18
|
-
def exercise(self, draft=None, *, paste=True, copy=True, lose_focus=False, mode="foreground", escape=True):
|
|
19
|
-
clipboard = Clipboard()
|
|
20
|
-
state = {"open": draft is not None, "text": draft or "", "selected": False,
|
|
21
|
-
"foreground": True, "public": [], "commands": []}
|
|
22
|
-
def key(vk, ctrl=False):
|
|
23
|
-
if vk == 0x1b:
|
|
24
|
-
if escape: state.update(open=False, text="", selected=False)
|
|
25
|
-
elif vk == 0xBF:
|
|
26
|
-
state["open"] = True
|
|
27
|
-
state["text"] += "/"
|
|
28
|
-
elif vk == windows.VK_RETURN:
|
|
29
|
-
if state["open"]:
|
|
30
|
-
text = state["text"]
|
|
31
|
-
if text: state["commands" if text.startswith("/") else "public"].append(text)
|
|
32
|
-
state.update(open=False, text="", selected=False)
|
|
33
|
-
else: state["open"] = True
|
|
34
|
-
elif ctrl and vk == 0x41: state["selected"] = True
|
|
35
|
-
elif ctrl and vk == windows.VK_V and state["open"]:
|
|
36
|
-
if paste:
|
|
37
|
-
state["text"] = ("" if state["selected"] else state["text"]) + clipboard.text
|
|
38
|
-
state["selected"] = False
|
|
39
|
-
if lose_focus: state["foreground"] = False
|
|
40
|
-
elif ctrl and vk == 0x43 and state["open"] and state["selected"] and copy:
|
|
41
|
-
clipboard.text = state["text"]
|
|
42
|
-
error = None
|
|
43
|
-
with patch.object(windows, "confirm_window", return_value=windows.WindowIdentity(1, 2, "D:/Game/Wow.exe", "test")), \
|
|
44
|
-
patch.object(windows, "focus_window"), \
|
|
45
|
-
patch.object(windows, "is_foreground", side_effect=lambda hwnd: state["foreground"]), \
|
|
46
|
-
patch.object(windows, "_send_key", side_effect=key), patch.object(windows.time, "sleep"):
|
|
47
|
-
try:
|
|
48
|
-
windows.send_command(1, "/reload", clipboard=clipboard, mode=mode)
|
|
49
|
-
except windows.InputError as exc: error = exc
|
|
50
|
-
self.assertEqual(state["public"], [], "automation submitted a public chat draft")
|
|
51
|
-
if paste:
|
|
52
|
-
self.assertEqual(clipboard.text, "previous clipboard")
|
|
53
|
-
return state, error
|
|
54
|
-
|
|
55
|
-
def test_existing_draft_is_cancelled(self):
|
|
56
|
-
state, error = self.exercise("unfinished public chat ")
|
|
57
|
-
self.assertIsNone(error)
|
|
58
|
-
self.assertEqual(state["commands"], ["/reload"])
|
|
59
|
-
|
|
60
|
-
def test_ignored_escape_cannot_submit_draft(self):
|
|
61
|
-
state, error = self.exercise("public draft", escape=False)
|
|
62
|
-
self.assertIsNone(error)
|
|
63
|
-
self.assertEqual(state["commands"], ["/reload"])
|
|
64
|
-
|
|
65
|
-
def test_messages_stays_background_and_cancels_draft(self):
|
|
66
|
-
state = {"open": True, "text": "public draft", "public": [], "commands": []}
|
|
67
|
-
def post(hwnd, message, value, lparam):
|
|
68
|
-
self.assertEqual(hwnd, 1)
|
|
69
|
-
if message == windows.WM_KEYDOWN:
|
|
70
|
-
if value == windows.VK_ESCAPE:
|
|
71
|
-
state.update(open=False, text="")
|
|
72
|
-
elif value == windows.VK_RETURN:
|
|
73
|
-
if state["open"]:
|
|
74
|
-
text = state["text"]
|
|
75
|
-
if text: state["commands" if text.startswith("/") else "public"].append(text)
|
|
76
|
-
state.update(open=False, text="")
|
|
77
|
-
else: state["open"] = True
|
|
78
|
-
elif message == windows.WM_CHAR:
|
|
79
|
-
self.assertEqual(lparam, 1)
|
|
80
|
-
if state["open"]: state["text"] += chr(value)
|
|
81
|
-
return 1
|
|
82
|
-
with patch.object(windows, "confirm_window", return_value=windows.WindowIdentity(1, 2, "D:/Wow.exe", "test")), \
|
|
83
|
-
patch.object(windows.user32, "PostMessageW", side_effect=post), \
|
|
84
|
-
patch.object(windows, "focus_window", side_effect=AssertionError("must stay background")), \
|
|
85
|
-
patch.object(windows, "_send_key", side_effect=AssertionError("must not SendInput")), \
|
|
86
|
-
patch.object(windows, "Clipboard", side_effect=AssertionError("must not use clipboard")), \
|
|
87
|
-
patch.object(windows.time, "sleep"):
|
|
88
|
-
windows.send_command(1, "/reload", mode="messages")
|
|
89
|
-
self.assertEqual(state["public"], [])
|
|
90
|
-
self.assertEqual(state["commands"], ["/reload"])
|
|
91
|
-
|
|
92
|
-
def test_background_rejection_does_not_queue_submit(self):
|
|
93
|
-
posted = []
|
|
94
|
-
def post(hwnd, message, value, lparam):
|
|
95
|
-
posted.append((message, value))
|
|
96
|
-
return message != windows.WM_CHAR
|
|
97
|
-
with patch.object(windows, "confirm_window", return_value=windows.WindowIdentity(1, 2, "D:/Wow.exe", "test")), \
|
|
98
|
-
patch.object(windows.user32, "PostMessageW", side_effect=post), \
|
|
99
|
-
patch.object(windows.time, "sleep"):
|
|
100
|
-
with self.assertRaises(windows.InputError):
|
|
101
|
-
windows.send_command(1, "/reload", mode="messages")
|
|
102
|
-
returns = [entry for entry in posted if entry == (windows.WM_KEYDOWN, windows.VK_RETURN)]
|
|
103
|
-
self.assertEqual(len(returns), 1, "failed typing must not queue final submit")
|
|
104
|
-
self.assertEqual(posted[-1], (windows.WM_KEYUP, windows.VK_ESCAPE))
|
|
105
|
-
|
|
106
|
-
def test_invalid_commands_never_focus_or_type(self):
|
|
107
|
-
with patch.object(windows, "focus_window") as focus, patch.object(windows, "_send_key") as key:
|
|
108
|
-
for command in ("hello", "/reload\n/dev", "/" + "a" * 255):
|
|
109
|
-
with self.assertRaises(windows.InputError):
|
|
110
|
-
windows.send_command(1, command)
|
|
111
|
-
focus.assert_not_called()
|
|
112
|
-
key.assert_not_called()
|
|
113
|
-
|
|
114
|
-
def test_closed_and_empty_chat(self):
|
|
115
|
-
for draft in (None, ""):
|
|
116
|
-
state, error = self.exercise(draft)
|
|
117
|
-
self.assertIsNone(error)
|
|
118
|
-
self.assertEqual(state["commands"], ["/reload"])
|
|
119
|
-
|
|
120
|
-
def test_failed_paste_or_copy_never_submits(self):
|
|
121
|
-
for options in ({"paste": False}, {"copy": False}):
|
|
122
|
-
state, error = self.exercise(**options)
|
|
123
|
-
self.assertIsNotNone(error)
|
|
124
|
-
self.assertEqual(state["commands"], [])
|
|
125
|
-
self.assertFalse(state["open"])
|
|
126
|
-
|
|
127
|
-
def test_focus_loss_never_submits(self):
|
|
128
|
-
state, error = self.exercise(lose_focus=True)
|
|
129
|
-
self.assertIsNotNone(error)
|
|
130
|
-
self.assertEqual(state["commands"], [])
|
|
131
|
-
|
|
132
|
-
if __name__ == "__main__": unittest.main()
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"""Offline protocol tests. No input is sent to a real window."""
|
|
2
|
-
import argparse
|
|
3
|
-
import json
|
|
4
|
-
import tempfile
|
|
5
|
-
import importlib.util
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
import unittest
|
|
8
|
-
from unittest.mock import patch
|
|
9
|
-
|
|
10
|
-
from automation import reload as reload_mod
|
|
11
|
-
from automation.session import Session
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def ready(nonce="current", **changes):
|
|
15
|
-
data = {"v":1,"kind":"reload","run":nonce,"status":"ready","ts":1000,
|
|
16
|
-
"client":"retail","build":"12.1.0.69875"}
|
|
17
|
-
data.update(changes)
|
|
18
|
-
return json.dumps(data)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class Capture:
|
|
22
|
-
window_closed = False
|
|
23
|
-
def __init__(self, frames): self.frames = iter(frames)
|
|
24
|
-
def __enter__(self): return self
|
|
25
|
-
def __exit__(self, *_): pass
|
|
26
|
-
def latest_roi(self): return next(self.frames, None)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class Windows:
|
|
30
|
-
def __init__(self, captures): self.captures = iter(captures)
|
|
31
|
-
def open_notice_capture(self, *_args, **_kwargs): return Capture(next(self.captures))
|
|
32
|
-
def decode_qr(self, frame): return frame
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class ReloadTests(unittest.TestCase):
|
|
36
|
-
def setUp(self):
|
|
37
|
-
self.directory = tempfile.TemporaryDirectory()
|
|
38
|
-
self.addCleanup(self.directory.cleanup)
|
|
39
|
-
self.session = Session(self.directory.name, "reload-test")
|
|
40
|
-
self.args = argparse.Namespace(hwnd=1,pid=2,exe_path="Wow.exe",timeout=.01,interval=.0001)
|
|
41
|
-
self.sent = []
|
|
42
|
-
self.deliver = lambda _s,_w,_a,text: self.sent.append(text)
|
|
43
|
-
|
|
44
|
-
def execute(self, windows, **kwargs):
|
|
45
|
-
return reload_mod.execute(windows,self.session,self.args,self.deliver,"current",**kwargs)
|
|
46
|
-
|
|
47
|
-
def test_marker(self):
|
|
48
|
-
self.assertIsNotNone(reload_mod.marker(ready(), "current"))
|
|
49
|
-
for value in (ready("old"),ready(v=2),ready(status="pending"),ready(kind="ack"),
|
|
50
|
-
ready(ts=True),ready(build=""),"[]","bad","x"*513):
|
|
51
|
-
self.assertIsNone(reload_mod.marker(value,"current"))
|
|
52
|
-
|
|
53
|
-
def test_success_stale_and_cleanup(self):
|
|
54
|
-
result = self.execute(Windows([[[ready("old")],[ready()]], [[ready()],[],[]]]))
|
|
55
|
-
self.assertEqual(result["status"],"reload_ready")
|
|
56
|
-
self.assertEqual(self.sent,["/dev auto reload current","/dev auto unidentify current"])
|
|
57
|
-
self.assertEqual(self.session.read_events()[-1]["event"],"reload_ready_cleared")
|
|
58
|
-
self.assertEqual(self.execute(Windows([]),resume=True)["status"],"already_completed")
|
|
59
|
-
self.assertEqual(len(self.sent),2)
|
|
60
|
-
|
|
61
|
-
def test_no_repeat_on_timeout_then_resume(self):
|
|
62
|
-
with self.assertRaises(reload_mod.ReloadError): self.execute(Windows([[]]))
|
|
63
|
-
with self.assertRaises(reload_mod.ReloadError): self.execute(Windows([]))
|
|
64
|
-
self.assertEqual(len(self.sent),1)
|
|
65
|
-
self.execute(Windows([[[ready()]], [[],[]]]),resume=True)
|
|
66
|
-
self.assertEqual(self.sent.count("/dev auto reload current"),1)
|
|
67
|
-
|
|
68
|
-
def test_no_frame_is_not_cleanup(self):
|
|
69
|
-
with self.assertRaises(reload_mod.ReloadError):
|
|
70
|
-
self.execute(Windows([[[ready()]], []]))
|
|
71
|
-
self.assertTrue(self.session.read_events("reload_ready_confirmed"))
|
|
72
|
-
self.assertFalse(self.session.read_events("reload_ready_cleared"))
|
|
73
|
-
self.execute(Windows([[[],[]]]),resume=True)
|
|
74
|
-
self.assertEqual(self.sent.count("/dev auto reload current"),1)
|
|
75
|
-
|
|
76
|
-
def test_wrong_binding_and_nonce(self):
|
|
77
|
-
with self.assertRaises(reload_mod.ReloadError): self.execute(Windows([]),resume=True)
|
|
78
|
-
with self.assertRaises(reload_mod.ReloadError): self.execute(Windows([[]]))
|
|
79
|
-
self.args.pid=3
|
|
80
|
-
with self.assertRaises(reload_mod.ReloadError): self.execute(Windows([]),resume=True)
|
|
81
|
-
self.assertEqual(len(self.sent),1)
|
|
82
|
-
|
|
83
|
-
def test_ticket_forwarding(self):
|
|
84
|
-
self.execute(Windows([[[ready()]], [[],[]]]),ticket="LYCHEE-TEST-1")
|
|
85
|
-
self.assertEqual(self.sent[0],"/dev auto reload current LYCHEE-TEST-1")
|
|
86
|
-
|
|
87
|
-
def test_timeout_artifact_only_on_failure(self):
|
|
88
|
-
with patch.object(reload_mod,"save_timeout_image",return_value="timeout.png") as save:
|
|
89
|
-
with self.assertRaises(reload_mod.ReloadError): self.execute(Windows([[]]))
|
|
90
|
-
save.assert_called_once()
|
|
91
|
-
self.assertEqual(self.session.read_events("reload_ready_timeout")[-1]["screenshot"],"timeout.png")
|
|
92
|
-
|
|
93
|
-
def test_output_flow_waits_before_read(self):
|
|
94
|
-
spec=importlib.util.spec_from_file_location("reload_cli_test",Path(__file__).with_name("automation.py"))
|
|
95
|
-
cli=importlib.util.module_from_spec(spec);spec.loader.exec_module(cli)
|
|
96
|
-
args=argparse.Namespace(**vars(self.args),sv="unused",data_dir=self.directory.name,installation="reload-test")
|
|
97
|
-
notice={"task":"probe","run":"request","ticket":"LYCHEE-TEST-1","ts":1000}
|
|
98
|
-
order=[]
|
|
99
|
-
with patch.object(cli,"reload_ready",side_effect=lambda *a,**k: order.append("ready")), \
|
|
100
|
-
patch.object(self.session,"wait_for_saved_variables",side_effect=lambda *a,**k: order.append("disk") or True), \
|
|
101
|
-
patch.object(cli,"cmd_sv",side_effect=lambda *a: order.append("read") or 0):
|
|
102
|
-
self.assertEqual(cli._notice_to_sv(self.session,object(),notice,args,revision="r1",request_type="task"),0)
|
|
103
|
-
self.assertEqual(order,["ready","disk","read"])
|
|
104
|
-
self.assertTrue(self.session.reload_already_requested("request","LYCHEE-TEST-1"))
|
|
105
|
-
|
|
106
|
-
def test_png_rgb(self):
|
|
107
|
-
try:
|
|
108
|
-
import numpy as np
|
|
109
|
-
except ImportError:
|
|
110
|
-
self.skipTest("optional capture dependency not installed")
|
|
111
|
-
import struct,zlib
|
|
112
|
-
image=np.array([[[0,0,255],[255,0,0]]],dtype=np.uint8)
|
|
113
|
-
path=reload_mod.save_timeout_image(self.session,"current",image)
|
|
114
|
-
data=Path(path).read_bytes()
|
|
115
|
-
self.assertEqual(data[:8],b"\x89PNG\r\n\x1a\n")
|
|
116
|
-
size=struct.unpack(">I",data[33:37])[0]
|
|
117
|
-
self.assertEqual(zlib.decompress(data[41:41+size]),b"\x00\xff\x00\x00\x00\x00\xff")
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if __name__ == "__main__": unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|