mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-29 17:05:13 +08:00
🔥 Sync 2026-09-05 21:18:46
This commit is contained in:
1 parent
e88d0b9fed
commit
b05ff8a1b6
45 files changed
+506
-272
No files matched your search
@@ -0,0 +1,32 @@
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
|
||||
|
||||
APP_DIR = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
class AgentFlowLuciOpenContractTest(unittest.TestCase):
|
||||
def read(self, relative):
|
||||
return (APP_DIR / relative).read_text(encoding="utf-8")
|
||||
|
||||
def test_luci_open_matches_linkease_proxy_pattern(self):
|
||||
makefile = self.read("Makefile")
|
||||
controller = self.read("luasrc/controller/agentflow.lua")
|
||||
status = self.read("luasrc/view/agentflow/status.htm")
|
||||
|
||||
self.assertNotIn("+luci-lib-linkeaseauth", makefile)
|
||||
self.assertIn('entry({"admin", "services", "agentflow", "open"}', controller)
|
||||
self.assertIn("open.sysauth = false", controller)
|
||||
self.assertIn("function agentflow_open()", controller)
|
||||
self.assertIn("uhttpd_apps_proxy_available()", controller)
|
||||
self.assertIn("linkeasefull_running()", controller)
|
||||
self.assertIn("return base_path", controller)
|
||||
self.assertIn("url_authority(request_or_lan_host(), port)", controller)
|
||||
self.assertIn("http.redirect(entry_url)", controller)
|
||||
self.assertNotIn('linkease_auth_url("auth")', controller)
|
||||
self.assertIn('url("admin/services/agentflow/open")', status)
|
||||
self.assertNotIn('window.location.hostname + ":" + st.port', status)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user