mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(tests): fix missing services in tests; fix ImageField instantiation
This commit is contained in:
parent
3000436121
commit
96adb56633
@ -35,6 +35,7 @@ def mock_services():
|
|||||||
graph_execution_manager = SqliteItemStorage[GraphExecutionState](filename = sqlite_memory, table_name = 'graph_executions'),
|
graph_execution_manager = SqliteItemStorage[GraphExecutionState](filename = sqlite_memory, table_name = 'graph_executions'),
|
||||||
processor = DefaultInvocationProcessor(),
|
processor = DefaultInvocationProcessor(),
|
||||||
restoration = None, # type: ignore
|
restoration = None, # type: ignore
|
||||||
|
configuration = None, # type: ignore
|
||||||
)
|
)
|
||||||
|
|
||||||
def invoke_next(g: GraphExecutionState, services: InvocationServices) -> tuple[BaseInvocation, BaseInvocationOutput]:
|
def invoke_next(g: GraphExecutionState, services: InvocationServices) -> tuple[BaseInvocation, BaseInvocationOutput]:
|
||||||
|
@ -33,6 +33,7 @@ def mock_services() -> InvocationServices:
|
|||||||
graph_execution_manager = SqliteItemStorage[GraphExecutionState](filename = sqlite_memory, table_name = 'graph_executions'),
|
graph_execution_manager = SqliteItemStorage[GraphExecutionState](filename = sqlite_memory, table_name = 'graph_executions'),
|
||||||
processor = DefaultInvocationProcessor(),
|
processor = DefaultInvocationProcessor(),
|
||||||
restoration = None, # type: ignore
|
restoration = None, # type: ignore
|
||||||
|
configuration = None, # type: ignore
|
||||||
)
|
)
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
|
@ -49,7 +49,7 @@ class ImageTestInvocation(BaseInvocation):
|
|||||||
prompt: str = Field(default = "")
|
prompt: str = Field(default = "")
|
||||||
|
|
||||||
def invoke(self, context: InvocationContext) -> ImageTestInvocationOutput:
|
def invoke(self, context: InvocationContext) -> ImageTestInvocationOutput:
|
||||||
return ImageTestInvocationOutput(image=ImageField(image_name=self.id, width=512, height=512, mode="", info={}))
|
return ImageTestInvocationOutput(image=ImageField(image_name=self.id))
|
||||||
|
|
||||||
class PromptCollectionTestInvocationOutput(BaseInvocationOutput):
|
class PromptCollectionTestInvocationOutput(BaseInvocationOutput):
|
||||||
type: Literal['test_prompt_collection_output'] = 'test_prompt_collection_output'
|
type: Literal['test_prompt_collection_output'] = 'test_prompt_collection_output'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user