forked from p15670423/monkey
UT: Use PydanticAgentEventSerializer in place of PydanticEventSerializer
This commit is contained in:
parent
43fd978ce4
commit
d729b514e5
|
@ -8,7 +8,7 @@ from pydantic import Field
|
|||
from common.event_serializers import (
|
||||
EVENT_TYPE_FIELD,
|
||||
IAgentEventSerializer,
|
||||
PydanticEventSerializer,
|
||||
PydanticAgentEventSerializer,
|
||||
)
|
||||
from common.events import AbstractAgentEvent
|
||||
|
||||
|
@ -31,7 +31,7 @@ class PydanticEvent(AbstractAgentEvent):
|
|||
|
||||
@pytest.fixture
|
||||
def pydantic_event_serializer() -> IAgentEventSerializer:
|
||||
return PydanticEventSerializer(PydanticEvent)
|
||||
return PydanticAgentEventSerializer(PydanticEvent)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
@ -6,7 +6,7 @@ import mongomock
|
|||
import pytest
|
||||
from pydantic import Field
|
||||
|
||||
from common.event_serializers import AgentEventSerializerRegistry, PydanticEventSerializer
|
||||
from common.event_serializers import AgentEventSerializerRegistry, PydanticAgentEventSerializer
|
||||
from common.events import AbstractAgentEvent
|
||||
from monkey_island.cc.repository import (
|
||||
IEventRepository,
|
||||
|
@ -36,8 +36,8 @@ EVENTS: List[AbstractAgentEvent] = [
|
|||
@pytest.fixture
|
||||
def event_serializer_registry() -> AgentEventSerializerRegistry:
|
||||
registry = AgentEventSerializerRegistry()
|
||||
registry[FakeAgentEvent] = PydanticEventSerializer(FakeAgentEvent)
|
||||
registry[FakeAgentItemEvent] = PydanticEventSerializer(FakeAgentItemEvent)
|
||||
registry[FakeAgentEvent] = PydanticAgentEventSerializer(FakeAgentEvent)
|
||||
registry[FakeAgentItemEvent] = PydanticAgentEventSerializer(FakeAgentItemEvent)
|
||||
return registry
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import pytest
|
|||
from tests.common import StubDIContainer
|
||||
|
||||
from common.event_queue import IAgentEventQueue
|
||||
from common.event_serializers import AgentEventSerializerRegistry, PydanticEventSerializer
|
||||
from common.event_serializers import AgentEventSerializerRegistry, PydanticAgentEventSerializer
|
||||
from common.events import AbstractAgentEvent
|
||||
from monkey_island.cc.resources import Events
|
||||
|
||||
|
@ -90,9 +90,11 @@ def mock_agent_event_queue():
|
|||
@pytest.fixture
|
||||
def event_serializer_registry() -> AgentEventSerializerRegistry:
|
||||
event_serializer_registry = AgentEventSerializerRegistry()
|
||||
event_serializer_registry[SomeAgentEvent] = PydanticEventSerializer(SomeAgentEvent)
|
||||
event_serializer_registry[OtherAgentEvent] = PydanticEventSerializer(OtherAgentEvent)
|
||||
event_serializer_registry[DifferentAgentEvent] = PydanticEventSerializer(DifferentAgentEvent)
|
||||
event_serializer_registry[SomeAgentEvent] = PydanticAgentEventSerializer(SomeAgentEvent)
|
||||
event_serializer_registry[OtherAgentEvent] = PydanticAgentEventSerializer(OtherAgentEvent)
|
||||
event_serializer_registry[DifferentAgentEvent] = PydanticAgentEventSerializer(
|
||||
DifferentAgentEvent
|
||||
)
|
||||
|
||||
return event_serializer_registry
|
||||
|
||||
|
|
Loading…
Reference in New Issue