strato_check_dns: klarer Status (match, local_override, mismatch, not_resolvable, not_in_zone)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cd734a6de2
commit
c1391cfb69
2 files changed
+45
-10
No files matched your search
@@ -247,6 +247,19 @@ class McpTicketTests(unittest.TestCase):
|
||||
self.mcp.strato_apply_change("create", "CNAME", "chat", ticket, True, value="gw.example.net")
|
||||
self.assertNotIn("POST", [r.method for r in self.opener.requests])
|
||||
|
||||
def test_check_dns_statuses(self) -> None:
|
||||
from unittest import mock
|
||||
|
||||
self.opener.responses[:0] = []
|
||||
table = {
|
||||
"media.example.de": ("media.example.de", [], ["192.168.1.2"]),
|
||||
"proxy.example.net": ("proxy.example.net", [], ["203.0.113.5"]),
|
||||
}
|
||||
with mock.patch.object(self.mcp.socket, "gethostbyname_ex", side_effect=lambda h: table[h]):
|
||||
result = json.loads(self.mcp.strato_check_dns("media"))
|
||||
self.assertEqual(result["status"], "local_override")
|
||||
self.assertEqual(result["zone_cname_target"], "proxy.example.net")
|
||||
|
||||
def test_errors_are_tool_errors(self) -> None:
|
||||
from mcp.server.fastmcp.exceptions import ToolError
|
||||
|
||||
|
||||
Reference in new issue
Block a user