s
This commit is contained in:
@@ -23,15 +23,23 @@ class ControlPlaneServiceTests(unittest.TestCase):
|
||||
)
|
||||
|
||||
def test_stack_summary_exposes_new_quick_links(self) -> None:
|
||||
links = stack_summary()["quick_links"]
|
||||
summary = stack_summary()
|
||||
links = summary["quick_links"]
|
||||
for key in (
|
||||
"mitmproxy",
|
||||
"vscode_server",
|
||||
"uptime_kuma",
|
||||
"pulseaudio_tcp",
|
||||
"openclaw",
|
||||
"neko_browser",
|
||||
"neko_browser_1",
|
||||
"neko_browser_2",
|
||||
"neko_browser_3",
|
||||
):
|
||||
self.assertIn(key, links)
|
||||
neko_instances = summary["neko_instances"]
|
||||
self.assertEqual([item["id"] for item in neko_instances], [1, 2, 3])
|
||||
self.assertEqual(links["neko_browser"], links["neko_browser_1"])
|
||||
|
||||
def test_deployment_report_marks_live_local_ready_when_checks_pass(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
|
||||
22
d2ypp2/tests/test_env_check.py
Normal file
22
d2ypp2/tests/test_env_check.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from scripts.env_check import _local_ips
|
||||
|
||||
|
||||
class EnvCheckTests(unittest.TestCase):
|
||||
def test_local_ips_skips_all_loopback_aliases(self) -> None:
|
||||
fake_info = [
|
||||
(None, None, None, None, ("127.0.0.1", 0)),
|
||||
(None, None, None, None, ("127.0.1.1", 0)),
|
||||
(None, None, None, None, ("192.168.50.10", 0)),
|
||||
]
|
||||
with patch("scripts.env_check.socket.gethostname", return_value="live"):
|
||||
with patch("scripts.env_check.socket.getaddrinfo", return_value=fake_info):
|
||||
self.assertEqual(_local_ips(), ["192.168.50.10"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user