进一步清理代码和注册过程
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user