1010 UiPathRuntimeEvent ,
1111 UiPathRuntimeFactoryProtocol ,
1212 UiPathRuntimeFactoryRegistry ,
13+ UiPathRuntimeFactorySettings ,
1314 UiPathRuntimeProtocol ,
1415 UiPathRuntimeResult ,
1516 UiPathRuntimeSchema ,
1617 UiPathRuntimeStatus ,
18+ UiPathRuntimeStorageProtocol ,
1719 UiPathStreamOptions ,
1820)
1921
2022
23+ class MockStorage (UiPathRuntimeStorageProtocol ):
24+ """Mock storage implementation"""
25+
26+ def __init__ (self ):
27+ self ._store = {}
28+
29+ async def set_value (self , runtime_id , namespace , key , value ):
30+ self ._store .setdefault (runtime_id , {}).setdefault (namespace , {})[key ] = value
31+
32+ async def get_value (self , runtime_id , namespace , key ):
33+ return self ._store .get (runtime_id , {}).get (namespace , {}).get (key )
34+
35+
2136class MockRuntime (UiPathRuntimeProtocol ):
2237 """Mock runtime instance"""
2338
@@ -59,8 +74,11 @@ def __init__(self, context: Optional[UiPathRuntimeContext] = None):
5974 def discover_entrypoints (self ) -> list [str ]:
6075 return ["main.py" , "handler.py" ]
6176
62- async def discover_runtimes (self ) -> list [UiPathRuntimeProtocol ]:
63- return []
77+ async def get_storage (self ) -> UiPathRuntimeStorageProtocol | None :
78+ return MockStorage ()
79+
80+ async def get_settings (self ) -> UiPathRuntimeFactorySettings | None :
81+ return UiPathRuntimeFactorySettings ()
6482
6583 async def new_runtime (
6684 self , entrypoint : str , runtime_id : str , ** kwargs
@@ -81,8 +99,11 @@ def __init__(self, context: Optional[UiPathRuntimeContext] = None):
8199 def discover_entrypoints (self ) -> list [str ]:
82100 return ["agent" , "workflow" ]
83101
84- async def discover_runtimes (self ) -> list [UiPathRuntimeProtocol ]:
85- return []
102+ async def get_storage (self ) -> UiPathRuntimeStorageProtocol | None :
103+ return MockStorage ()
104+
105+ async def get_settings (self ) -> UiPathRuntimeFactorySettings | None :
106+ return UiPathRuntimeFactorySettings ()
86107
87108 async def new_runtime (
88109 self , entrypoint : str , runtime_id : str , ** kwargs
@@ -103,8 +124,11 @@ def __init__(self, context: Optional[UiPathRuntimeContext] = None):
103124 def discover_entrypoints (self ) -> list [str ]:
104125 return ["chatbot" , "rag" ]
105126
106- async def discover_runtimes (self ) -> list [UiPathRuntimeProtocol ]:
107- return []
127+ async def get_storage (self ) -> UiPathRuntimeStorageProtocol | None :
128+ return MockStorage ()
129+
130+ async def get_settings (self ) -> UiPathRuntimeFactorySettings | None :
131+ return UiPathRuntimeFactorySettings ()
108132
109133 async def new_runtime (
110134 self , entrypoint : str , runtime_id : str , ** kwargs
0 commit comments