Local changes: Updated model training, removed debug instrumentation, and configuration improvements
This commit is contained in:
31
tests/unit/resilience/test_state_manager.py
Normal file
31
tests/unit/resilience/test_state_manager.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""Tests for state manager."""
|
||||
|
||||
import pytest
|
||||
from src.resilience.state_manager import get_state_manager, StateManager
|
||||
|
||||
|
||||
class TestStateManager:
|
||||
"""Tests for StateManager."""
|
||||
|
||||
@pytest.fixture
|
||||
def state_manager(self):
|
||||
"""Create state manager instance."""
|
||||
return get_state_manager()
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_save_state(self, state_manager):
|
||||
"""Test saving state."""
|
||||
result = await state_manager.save_state("test_key", {"data": "value"})
|
||||
assert result is True
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_load_state(self, state_manager):
|
||||
"""Test loading state."""
|
||||
# Save first
|
||||
await state_manager.save_state("test_key", {"data": "value"})
|
||||
|
||||
# Load
|
||||
state = await state_manager.load_state("test_key")
|
||||
assert state is not None
|
||||
assert state.get("data") == "value"
|
||||
|
||||
Reference in New Issue
Block a user