Files
manual_slop/tests/test_api_events.py

21 lines
735 B
Python

import pytest
from unittest.mock import MagicMock
import ai_client
def test_ai_client_event_emitter_exists():
# This should fail initially because 'events' won't exist on ai_client
assert hasattr(ai_client, 'events')
assert ai_client.events is not None
def test_event_emission():
# We'll expect these event names based on the spec
mock_callback = MagicMock()
ai_client.events.on("request_start", mock_callback)
# Trigger something that should emit the event (once implemented)
# For now, we just test the emitter itself if we were to call it manually
ai_client.events.emit("request_start", payload={"model": "test"})
mock_callback.assert_called_once_with(payload={"model": "test"})