@@ -203,14 +203,16 @@ function _restcall_mocked(method, url, headers, payload; query)
203
203
],
204
204
) |> jsonresponse (200 )
205
205
elseif (method == :GET ) && endswith (url, " app/packages/registries" )
206
- Dict (
207
- " success" => true , " message" => " " ,
208
- " registries" => [
206
+ packages_registries = get (MOCK_JULIAHUB_STATE, :app_packages_registries ) do
207
+ [
209
208
# ! format: off
210
209
Dict (" name" => " General" , " uuid" => " 23338594-aafe-5451-b93e-139f81909106" , " id" => 1 ),
211
210
Dict (" name" => " JuliaComputingRegistry" , " uuid" => " bbcd6645-47a4-41f8-a415-d8fc8421bd34" , " id" => 266 ),
212
211
# ! format: on
213
- ],
212
+ ]
213
+ end
214
+ Dict (
215
+ " success" => true , " message" => " " , " registries" => packages_registries
214
216
) |> jsonresponse (200 )
215
217
elseif (method == :GET ) && endswith (url, " app/applications/default" )
216
218
r = if apiv >= v " 0.0.1"
@@ -251,27 +253,33 @@ function _restcall_mocked(method, url, headers, payload; query)
251
253
end
252
254
r |> jsonresponse (200 )
253
255
elseif (method == :GET ) && endswith (url, " app/applications/info" )
254
- Any[
255
- Dict (
256
- " name" => " RegisteredPackageApp" ,
257
- " uuid" => " db8b4d46-bfad-4aa5-a5f8-40df1e9542e5" ,
258
- " registrymap" => Any[Dict (" status" => true , " id" => " 1" )],
259
- ),
260
- Dict (
261
- " name" => " CustomDashboardApp" ,
262
- " uuid" => " 539b0f2a-a771-427e-a3ea-5fa1ee615c0c" ,
263
- " registrymap" => Any[Dict (" status" => true , " id" => " 266" )],
264
- ),
265
- ] |> jsonresponse (200 )
256
+ applications_info = get (MOCK_JULIAHUB_STATE, :app_applications_info ) do
257
+ Any[
258
+ Dict (
259
+ " name" => " RegisteredPackageApp" ,
260
+ " uuid" => " db8b4d46-bfad-4aa5-a5f8-40df1e9542e5" ,
261
+ " registrymap" => Any[Dict (" status" => true , " id" => " 1" )],
262
+ ),
263
+ Dict (
264
+ " name" => " CustomDashboardApp" ,
265
+ " uuid" => " 539b0f2a-a771-427e-a3ea-5fa1ee615c0c" ,
266
+ " registrymap" => Any[Dict (" status" => true , " id" => " 266" )],
267
+ ),
268
+ ]
269
+ end
270
+ applications_info |> jsonresponse (200 )
266
271
elseif (method == :GET ) && endswith (url, " app/applications/myapps" )
267
- # ! format: off
268
- Any[
269
- Dict (
270
- " name" => " ExampleApp.jl" ,
271
- " repourl" => " https://github.com/JuliaHubExampleOrg/ExampleApp.jl" ,
272
- ),
273
- ] |> jsonresponse (200 )
274
- # ! format: on
272
+ applications_myapps = get (MOCK_JULIAHUB_STATE, :app_applications_myapps ) do
273
+ # ! format: off
274
+ Any[
275
+ Dict (
276
+ " name" => " ExampleApp.jl" ,
277
+ " repourl" => " https://github.com/JuliaHubExampleOrg/ExampleApp.jl" ,
278
+ ),
279
+ ]
280
+ # ! format: on
281
+ end
282
+ applications_myapps |> jsonresponse (200 )
275
283
elseif (method == :POST ) && endswith (url, " juliaruncloud/submit_job" )
276
284
jobname = " jr-xf4tslavut"
277
285
Dict (" message" => " " , " success" => true , " jobname" => jobname) |> jsonresponse (200 )
0 commit comments