1111import pytest
1212
1313from guidellm .backends .backend import Backend , BackendType
14- from guidellm .scheduler import BackendInterface , ScheduledRequestInfo
15- from guidellm .schemas .response import (
14+ from guidellm .schemas import (
1615 GenerationRequest ,
17- GenerationRequestTimings ,
16+ RequestInfo ,
1817)
18+ from guidellm .schemas .request import GenerationRequestArguments
1919from guidellm .utils import RegistryMixin
2020from tests .unit .testing_utils import async_timeout
2121
@@ -41,6 +41,7 @@ def valid_instances(self, request):
4141 constructor_args = request .param
4242
4343 class TestBackend (Backend ):
44+ @property
4445 def info (self ) -> dict [str , Any ]:
4546 return {"type" : self .type_ }
4647
@@ -68,7 +69,11 @@ async def default_model(self) -> str | None:
6869 def test_class_signatures (self ):
6970 """Test Backend inheritance and type relationships."""
7071 assert issubclass (Backend , RegistryMixin )
71- assert isinstance (Backend , BackendInterface )
72+ # Check that Backend implements BackendInterface methods
73+ assert hasattr (Backend , "resolve" )
74+ assert hasattr (Backend , "process_startup" )
75+ assert hasattr (Backend , "process_shutdown" )
76+ assert hasattr (Backend , "validate" )
7277 assert hasattr (Backend , "create" )
7378 assert hasattr (Backend , "register" )
7479 assert hasattr (Backend , "get_registered_object" )
@@ -100,6 +105,7 @@ def test_invalid_initialization_values(self, field, value):
100105 """Test Backend with invalid field values."""
101106
102107 class TestBackend (Backend ):
108+ @property
103109 def info (self ) -> dict [str , Any ]:
104110 return {}
105111
@@ -147,15 +153,10 @@ async def test_interface_compatibility(self, valid_instances):
147153 instance , _ = valid_instances
148154
149155 # Test that Backend uses the correct generic types
150- request = GenerationRequest (content = "test" )
151- request_info = ScheduledRequestInfo (
152- request_id = "test-id" ,
153- status = "pending" ,
154- scheduler_node_id = 1 ,
155- scheduler_process_id = 1 ,
156- scheduler_start_time = 123.0 ,
157- request_timings = GenerationRequestTimings (),
156+ request = GenerationRequest (
157+ request_type = "text_completions" , arguments = GenerationRequestArguments ()
158158 )
159+ request_info = RequestInfo (request_id = "test-id" )
159160
160161 # Test resolve method
161162 async for response , info in instance .resolve (request , request_info ):
0 commit comments