4141 try :
4242 from src .backend .app import app # preferred if file exists
4343 except ModuleNotFoundError :
44- # fallback to app_kernel which exists in this repo
44+ # fallback to app which exists in this repo
4545 import importlib
46- mod = importlib .import_module ("src.backend.app_kernel " )
46+ mod = importlib .import_module ("src.backend.app " )
4747 app = getattr (mod , "app" , None )
4848 if app is None :
4949 create_app = getattr (mod , "create_app" , None )
@@ -95,9 +95,9 @@ def test_process_request_endpoint_success():
9595 headers = {"Authorization" : "Bearer mock-token" }
9696
9797 # Mock the RAI success function
98- with patch ("app_kernel .rai_success" , return_value = True ), \
99- patch ("app_kernel .initialize_runtime_and_context" ) as mock_init , \
100- patch ("app_kernel .track_event_if_configured" ) as mock_track :
98+ with patch ("app .rai_success" , return_value = True ), \
99+ patch ("app .initialize_runtime_and_context" ) as mock_init , \
100+ patch ("app .track_event_if_configured" ) as mock_track :
101101
102102 # Mock memory store
103103 mock_memory_store = MagicMock ()
@@ -132,8 +132,8 @@ def test_process_request_endpoint_rai_failure():
132132 headers = {"Authorization" : "Bearer mock-token" }
133133
134134 # Mock the RAI failure
135- with patch ("app_kernel .rai_success" , return_value = False ), \
136- patch ("app_kernel .track_event_if_configured" ) as mock_track :
135+ with patch ("app .rai_success" , return_value = False ), \
136+ patch ("app .track_event_if_configured" ) as mock_track :
137137
138138 test_input = {
139139 "session_id" : "test-session-123" ,
@@ -154,8 +154,8 @@ def test_process_request_endpoint_harmful_content():
154154 headers = {"Authorization" : "Bearer mock-token" }
155155
156156 # Mock the RAI failure for harmful content
157- with patch ("app_kernel .rai_success" , return_value = False ), \
158- patch ("app_kernel .track_event_if_configured" ) as mock_track :
157+ with patch ("app .rai_success" , return_value = False ), \
158+ patch ("app .track_event_if_configured" ) as mock_track :
159159
160160 test_input = {
161161 "session_id" : "test-session-456" ,
@@ -180,8 +180,8 @@ def test_process_request_endpoint_real_rai_check():
180180 headers = {"Authorization" : "Bearer mock-token" }
181181
182182 # Don't mock RAI - let it run the real check
183- with patch ("app_kernel .initialize_runtime_and_context" ) as mock_init , \
184- patch ("app_kernel .track_event_if_configured" ) as mock_track :
183+ with patch ("app .initialize_runtime_and_context" ) as mock_init , \
184+ patch ("app .track_event_if_configured" ) as mock_track :
185185
186186 # Mock memory store
187187 mock_memory_store = MagicMock ()
0 commit comments