Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/jsonlogic/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, operator_id: str, /) -> None:
self.operator_id = operator_id


class UnkownOperator(Exception):
class UnknownOperator(Exception):
"""The provided ID does not exist in the registry."""

def __init__(self, operator_id: str, /) -> None:
Expand All @@ -42,7 +42,7 @@ class OperatorRegistry:
>>> reg.get("unknown")
Traceback (most recent call last):
...
UnkownOperator: "unknown"
UnknownOperator: "unknown"
"""

def __init__(self) -> None:
Expand Down Expand Up @@ -102,12 +102,12 @@ def get(self, operator_id: str, /) -> OperatorType:
operator_id: The registered ID of the operator.

Raises:
UnkownOperator: If the provided ID does not exist.
UnknownOperator: If the provided ID does not exist.
"""
try:
return self._registry[operator_id]
except KeyError:
raise UnkownOperator(operator_id) # noqa: B904
raise UnknownOperator(operator_id) # noqa: B904

def remove(self, operator_id: str, /) -> None:
"""Remove the operator from the registry.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_registry.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from jsonlogic.core import Operator
from jsonlogic.registry import AlreadyRegistered, OperatorRegistry, UnkownOperator
from jsonlogic.registry import AlreadyRegistered, OperatorRegistry, UnknownOperator


def test_operator_registry():
Expand Down Expand Up @@ -56,7 +56,7 @@ class Var2(Operator):
def test_get_unknown():
registry = OperatorRegistry()

with pytest.raises(UnkownOperator) as exc:
with pytest.raises(UnknownOperator) as exc:
registry.get("unknown")

assert exc.value.operator_id == "unknown"
Expand Down
Loading