e4dcfc49aa
Tests / Import Check (Python 3.13) (push) Has been cancelled
Tests / Import Check (Python 3.14) (push) Has been cancelled
Tests / Python Tests (Python 3.11) (push) Has been cancelled
Tests / Python Tests (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.14) (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Tests / Lint and Format (push) Has been cancelled
Tests / Web Node Tests (push) Has been cancelled
Tests / Import Check (Python 3.11) (push) Has been cancelled
Tests / Import Check (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.13) (push) Has been cancelled
22 lines
625 B
Python
22 lines
625 B
Python
"""Tests for provider registry utilities."""
|
|
|
|
from deeptutor.services.llm import registry
|
|
|
|
|
|
def test_registry_register_and_lookup() -> None:
|
|
"""Registering a provider should make it discoverable."""
|
|
|
|
class _Provider:
|
|
pass
|
|
|
|
name = "registry_test"
|
|
registry._provider_registry.pop(name, None)
|
|
try:
|
|
decorated = registry.register_provider(name)(_Provider)
|
|
|
|
assert registry.is_provider_registered(name) is True
|
|
assert registry.get_provider_class(name) is decorated
|
|
assert name in registry.list_providers()
|
|
finally:
|
|
registry._provider_registry.pop(name, None)
|