进一步清理代码和注册过程

This commit is contained in:
strepsiades
2026-03-18 17:23:31 +08:00
parent 32fa374e86
commit f9f175ee79
7 changed files with 42 additions and 49 deletions
@@ -22,7 +22,7 @@ class RegistryLookupApiHandler:
__test__ = False
class RegistryLookupDbHandler:
class RegistryLookupCustomHandler:
__test__ = False
@@ -33,7 +33,7 @@ def test_registry_supports_unified_handler_lookup() -> None:
reg = DomainRegistry.get_registration(node_type)
reg.jsonl_handler_class = RegistryLookupJsonlHandler
reg.api_handler_class = RegistryLookupApiHandler
reg.db_handler_class = RegistryLookupDbHandler
reg.handler_classes["custom"] = RegistryLookupCustomHandler
else:
DomainRegistry.register(
node_type=node_type,
@@ -41,9 +41,9 @@ def test_registry_supports_unified_handler_lookup() -> None:
node_class=RegistryLookupNode,
jsonl_handler_class=RegistryLookupJsonlHandler,
api_handler_class=RegistryLookupApiHandler,
db_handler_class=RegistryLookupDbHandler,
)
DomainRegistry.register_handler(node_type, "custom", RegistryLookupCustomHandler)
assert DomainRegistry.get_handler(node_type, "jsonl") is RegistryLookupJsonlHandler
assert DomainRegistry.get_handler(node_type, "api") is RegistryLookupApiHandler
assert DomainRegistry.get_handler(node_type, "db") is RegistryLookupDbHandler
assert DomainRegistry.get_handler(node_type, "custom") is RegistryLookupCustomHandler