Typed decision/classification service with an in-process gte-small ONNX embedding engine and lexical fallback, JS/Python SDKs, adapters, and the otsone model family. Apache-2.0 (sub-packages keep their MIT licenses). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
import inspect
|
|
from types import ModuleType
|
|
|
|
import pytest
|
|
from syrupy.assertion import SnapshotAssertion
|
|
|
|
import openjev
|
|
from openjev import AsyncTypeSafeClient, TypeSafeClient
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"module",
|
|
[openjev, openjev.constants],
|
|
ids=lambda module: module.__name__,
|
|
)
|
|
def test_public_members(module: ModuleType, snapshot: SnapshotAssertion) -> None:
|
|
members = (
|
|
module.__all__
|
|
if module is openjev
|
|
else (name for name in vars(module) if not name.startswith("_"))
|
|
)
|
|
assert sorted(members) == snapshot
|
|
|
|
|
|
def test_package_exports() -> None:
|
|
assert not any(name.startswith("_") for name in openjev.__all__)
|
|
|
|
|
|
@pytest.mark.parametrize("client_type", [AsyncTypeSafeClient, TypeSafeClient])
|
|
def test_constructor_kwargs(
|
|
client_type: type[AsyncTypeSafeClient] | type[TypeSafeClient],
|
|
snapshot: SnapshotAssertion,
|
|
) -> None:
|
|
parameters = inspect.signature(client_type).parameters
|
|
assert list(parameters) == snapshot
|
|
assert all(
|
|
parameter.kind is inspect.Parameter.KEYWORD_ONLY
|
|
for parameter in parameters.values()
|
|
)
|
|
assert all(parameter.default is None for parameter in parameters.values())
|