pygeai 0.5.0__py3-none-any.whl → 0.6.0b3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pygeai/__init__.py +1 -1
- pygeai/auth/__init__.py +0 -0
- pygeai/auth/clients.py +55 -0
- pygeai/auth/endpoints.py +2 -0
- pygeai/cli/__init__.py +0 -1
- pygeai/cli/commands/auth.py +123 -0
- pygeai/cli/commands/base.py +22 -1
- pygeai/cli/commands/docs.py +105 -0
- pygeai/cli/texts/help.py +157 -24
- pygeai/core/files/responses.py +4 -3
- pygeai/lab/clients.py +3 -3
- pygeai/lab/tools/clients.py +4 -4
- pygeai/tests/admin/test_clients.py +143 -0
- pygeai/tests/auth/__init__.py +0 -0
- pygeai/tests/auth/test_clients.py +105 -0
- pygeai/tests/cli/commands/lab/test_ai_lab.py +41 -35
- pygeai/tests/cli/commands/lab/test_spec.py +24 -56
- pygeai/tests/cli/commands/test_chat.py +21 -3
- pygeai/tests/cli/commands/test_evaluation.py +649 -0
- pygeai/tests/cli/commands/test_secrets.py +171 -0
- pygeai/tests/core/base/data/models.py +7 -0
- pygeai/tests/core/base/test_mappers.py +43 -11
- pygeai/tests/core/base/test_models.py +3 -1
- pygeai/tests/core/base/test_responses.py +53 -0
- pygeai/tests/core/common/test_config.py +2 -3
- pygeai/tests/core/files/test_mappers.py +137 -0
- pygeai/tests/core/plugins/__init__.py +0 -0
- pygeai/tests/core/plugins/test_clients.py +64 -0
- pygeai/tests/evaluation/__init__.py +0 -0
- pygeai/tests/evaluation/dataset/__init__.py +0 -0
- pygeai/tests/evaluation/dataset/test_clients.py +263 -0
- pygeai/tests/evaluation/plan/__init__.py +0 -0
- pygeai/tests/evaluation/plan/test_clients.py +193 -0
- pygeai/tests/evaluation/result/__init__.py +0 -0
- pygeai/tests/evaluation/result/test_clients.py +64 -0
- pygeai/tests/integration/assistants/rag/test_create_rag.py +1 -1
- pygeai/tests/integration/chat/test_generate_image.py +1 -1
- pygeai/tests/integration/lab/agents/test_agents_list.py +1 -1
- pygeai/tests/integration/lab/agents/test_create_agent.py +3 -3
- pygeai/tests/integration/lab/agents/test_create_sharing_link.py +1 -1
- pygeai/tests/integration/lab/agents/test_delete_agent.py +2 -2
- pygeai/tests/integration/lab/agents/test_get_agent.py +1 -1
- pygeai/tests/integration/lab/agents/test_publish_agent_revision.py +2 -2
- pygeai/tests/integration/lab/agents/test_update_agent.py +3 -3
- pygeai/tests/integration/lab/processes/test_create_process.py +1 -1
- pygeai/tests/integration/lab/processes/test_create_task.py +211 -0
- pygeai/tests/integration/lab/processes/test_delete_process.py +111 -0
- pygeai/tests/integration/lab/processes/test_get_process.py +1 -1
- pygeai/tests/integration/lab/processes/test_list_process_instances.py +91 -0
- pygeai/tests/integration/lab/processes/test_list_processes.py +138 -0
- pygeai/tests/integration/lab/processes/test_publish_process_revision.py +232 -0
- pygeai/tests/integration/lab/processes/test_update_process.py +1 -1
- pygeai/tests/integration/lab/reasoning_strategies/test_get_reasoning_strategy.py +1 -1
- pygeai/tests/integration/lab/reasoning_strategies/test_list_reasoning_strategies.py +1 -1
- pygeai/tests/integration/lab/reasoning_strategies/test_update_reasoning_strategy.py +1 -1
- pygeai/tests/integration/lab/tools/test_create_tool.py +1 -1
- pygeai/tests/integration/lab/tools/test_delete_tool.py +1 -1
- pygeai/tests/integration/lab/tools/test_get_parameter.py +1 -1
- pygeai/tests/integration/lab/tools/test_get_tool.py +1 -1
- pygeai/tests/integration/lab/tools/test_list_tools.py +1 -1
- pygeai/tests/integration/lab/tools/test_publish_tool_revision.py +1 -1
- pygeai/tests/integration/lab/tools/test_set_parameter.py +1 -1
- pygeai/tests/integration/lab/tools/test_update_tool.py +1 -1
- pygeai/tests/lab/agents/test_clients.py +17 -34
- pygeai/tests/lab/processes/test_clients.py +30 -93
- pygeai/tests/lab/processes/test_mappers.py +12 -71
- pygeai/tests/lab/strategies/test_clients.py +63 -63
- pygeai/tests/lab/test_managers.py +3 -6
- pygeai/tests/lab/test_models.py +9 -8
- pygeai/tests/lab/tools/test_clients.py +22 -45
- pygeai/tests/migration/test_strategies.py +16 -16
- pygeai/tests/organization/test_mappers.py +11 -4
- pygeai/tests/organization/test_responses.py +137 -0
- {pygeai-0.5.0.dist-info → pygeai-0.6.0b3.dist-info}/METADATA +1 -1
- {pygeai-0.5.0.dist-info → pygeai-0.6.0b3.dist-info}/RECORD +79 -53
- {pygeai-0.5.0.dist-info → pygeai-0.6.0b3.dist-info}/WHEEL +0 -0
- {pygeai-0.5.0.dist-info → pygeai-0.6.0b3.dist-info}/entry_points.txt +0 -0
- {pygeai-0.5.0.dist-info → pygeai-0.6.0b3.dist-info}/licenses/LICENSE +0 -0
- {pygeai-0.5.0.dist-info → pygeai-0.6.0b3.dist-info}/top_level.txt +0 -0
|
@@ -14,9 +14,9 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
16
|
def setUp(self):
|
|
17
|
-
self.client = AgenticProcessClient()
|
|
18
|
-
self.client.api_service = MagicMock()
|
|
19
17
|
self.project_id = "test-project-id"
|
|
18
|
+
self.client = AgenticProcessClient(api_key="test_key", base_url="https://test.url", project_id=self.project_id)
|
|
19
|
+
self.client.api_service = MagicMock()
|
|
20
20
|
self.process_id = "test-process-id"
|
|
21
21
|
self.process_name = "test-process-name"
|
|
22
22
|
self.task_id = "test-task-id"
|
|
@@ -124,7 +124,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
124
124
|
self.client.api_service.put.return_value = self.mock_response
|
|
125
125
|
|
|
126
126
|
result = self.client.update_process(
|
|
127
|
-
project_id=self.project_id,
|
|
128
127
|
name="Test Process",
|
|
129
128
|
key="updated-key",
|
|
130
129
|
automatic_publish=False,
|
|
@@ -138,7 +137,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
138
137
|
self.client.api_service.put.return_value = self.mock_response
|
|
139
138
|
|
|
140
139
|
result = self.client.update_process(
|
|
141
|
-
project_id=self.project_id,
|
|
142
140
|
process_id=self.process_id,
|
|
143
141
|
name="Upserted Process",
|
|
144
142
|
automatic_publish=True,
|
|
@@ -156,7 +154,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
156
154
|
|
|
157
155
|
try:
|
|
158
156
|
result = self.client.update_process(
|
|
159
|
-
project_id=self.project_id,
|
|
160
157
|
process_id=self.process_id,
|
|
161
158
|
name="Updated Process"
|
|
162
159
|
)
|
|
@@ -169,7 +166,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
169
166
|
self.client.api_service.get.return_value = self.mock_response
|
|
170
167
|
|
|
171
168
|
result = self.client.get_process(
|
|
172
|
-
project_id=self.project_id,
|
|
173
169
|
process_name="Test Process",
|
|
174
170
|
revision="1",
|
|
175
171
|
version=1,
|
|
@@ -185,7 +181,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
185
181
|
|
|
186
182
|
try:
|
|
187
183
|
result = self.client.get_process(
|
|
188
|
-
project_id=self.project_id,
|
|
189
184
|
process_id=self.process_id
|
|
190
185
|
)
|
|
191
186
|
except InvalidAPIResponseException as e:
|
|
@@ -198,9 +193,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
198
193
|
self.client.api_service.get.return_value = self.mock_response
|
|
199
194
|
|
|
200
195
|
try:
|
|
201
|
-
result = self.client.list_processes(
|
|
202
|
-
project_id=self.project_id
|
|
203
|
-
)
|
|
196
|
+
result = self.client.list_processes()
|
|
204
197
|
except InvalidAPIResponseException as e:
|
|
205
198
|
result = self.mock_response.text
|
|
206
199
|
|
|
@@ -210,7 +203,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
210
203
|
self.client.api_service.get.return_value = self.mock_response
|
|
211
204
|
|
|
212
205
|
result = self.client.list_process_instances(
|
|
213
|
-
project_id=self.project_id,
|
|
214
206
|
process_id=self.process_id,
|
|
215
207
|
is_active=False,
|
|
216
208
|
start="5",
|
|
@@ -226,7 +218,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
226
218
|
|
|
227
219
|
try:
|
|
228
220
|
result = self.client.list_process_instances(
|
|
229
|
-
project_id=self.project_id,
|
|
230
221
|
process_id=self.process_id
|
|
231
222
|
)
|
|
232
223
|
except InvalidAPIResponseException as e:
|
|
@@ -235,15 +226,15 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
235
226
|
self.assertEqual(result, "success text")
|
|
236
227
|
|
|
237
228
|
def test_delete_process_success_with_name(self):
|
|
229
|
+
self.mock_response.status_code = 204
|
|
238
230
|
self.client.api_service.delete.return_value = self.mock_response
|
|
239
231
|
|
|
240
232
|
result = self.client.delete_process(
|
|
241
|
-
project_id=self.project_id,
|
|
242
233
|
process_name="Test Process"
|
|
243
234
|
)
|
|
244
235
|
|
|
245
236
|
self.client.api_service.delete.assert_called_once()
|
|
246
|
-
self.assertEqual(result, {
|
|
237
|
+
self.assertEqual(result, {})
|
|
247
238
|
|
|
248
239
|
def test_delete_process_json_decode_error(self):
|
|
249
240
|
self.mock_response.json.side_effect = JSONDecodeError("Invalid JSON", "", 0)
|
|
@@ -251,7 +242,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
251
242
|
|
|
252
243
|
try:
|
|
253
244
|
result = self.client.delete_process(
|
|
254
|
-
project_id=self.project_id,
|
|
255
245
|
process_id=self.process_id
|
|
256
246
|
)
|
|
257
247
|
except InvalidAPIResponseException as e:
|
|
@@ -263,7 +253,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
263
253
|
self.client.api_service.post.return_value = self.mock_response
|
|
264
254
|
|
|
265
255
|
result = self.client.publish_process_revision(
|
|
266
|
-
project_id=self.project_id,
|
|
267
256
|
process_name="Test Process",
|
|
268
257
|
revision="2"
|
|
269
258
|
)
|
|
@@ -274,7 +263,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
274
263
|
def test_publish_process_revision_missing_identifier(self):
|
|
275
264
|
with self.assertRaises(ValueError) as context:
|
|
276
265
|
self.client.publish_process_revision(
|
|
277
|
-
project_id=self.project_id,
|
|
278
266
|
revision="2"
|
|
279
267
|
)
|
|
280
268
|
|
|
@@ -286,7 +274,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
286
274
|
|
|
287
275
|
try:
|
|
288
276
|
result = self.client.publish_process_revision(
|
|
289
|
-
project_id=self.project_id,
|
|
290
277
|
process_id=self.process_id,
|
|
291
278
|
revision="2"
|
|
292
279
|
)
|
|
@@ -301,7 +288,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
301
288
|
|
|
302
289
|
try:
|
|
303
290
|
result = self.client.create_task(
|
|
304
|
-
project_id=self.project_id,
|
|
305
291
|
name="Test Task"
|
|
306
292
|
)
|
|
307
293
|
except InvalidAPIResponseException as e:
|
|
@@ -313,7 +299,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
313
299
|
self.client.api_service.post.return_value = self.mock_response
|
|
314
300
|
|
|
315
301
|
result = self.client.create_task(
|
|
316
|
-
project_id=self.project_id,
|
|
317
302
|
name="Test Task",
|
|
318
303
|
description="Task Description",
|
|
319
304
|
title_template="Task for {{issue}}",
|
|
@@ -330,7 +315,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
330
315
|
self.client.api_service.get.return_value = self.mock_response
|
|
331
316
|
|
|
332
317
|
result = self.client.get_task(
|
|
333
|
-
project_id=self.project_id,
|
|
334
318
|
task_id="",
|
|
335
319
|
task_name="Test Task"
|
|
336
320
|
)
|
|
@@ -344,7 +328,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
344
328
|
|
|
345
329
|
try:
|
|
346
330
|
result = self.client.get_task(
|
|
347
|
-
project_id=self.project_id,
|
|
348
331
|
task_id=self.task_id
|
|
349
332
|
)
|
|
350
333
|
except InvalidAPIResponseException as e:
|
|
@@ -356,7 +339,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
356
339
|
self.client.api_service.get.return_value = self.mock_response
|
|
357
340
|
|
|
358
341
|
result = self.client.list_tasks(
|
|
359
|
-
project_id=self.project_id,
|
|
360
342
|
id="task1",
|
|
361
343
|
start="10",
|
|
362
344
|
count="50",
|
|
@@ -371,9 +353,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
371
353
|
self.client.api_service.get.return_value = self.mock_response
|
|
372
354
|
|
|
373
355
|
try:
|
|
374
|
-
result = self.client.list_tasks(
|
|
375
|
-
project_id=self.project_id
|
|
376
|
-
)
|
|
356
|
+
result = self.client.list_tasks()
|
|
377
357
|
except InvalidAPIResponseException as e:
|
|
378
358
|
result = self.mock_response.text
|
|
379
359
|
|
|
@@ -382,7 +362,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
382
362
|
def test_update_task_missing_id(self):
|
|
383
363
|
with self.assertRaises(ValueError) as context:
|
|
384
364
|
self.client.update_task(
|
|
385
|
-
project_id=self.project_id,
|
|
386
365
|
task_id=""
|
|
387
366
|
)
|
|
388
367
|
|
|
@@ -392,7 +371,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
392
371
|
self.client.api_service.put.return_value = self.mock_response
|
|
393
372
|
|
|
394
373
|
result = self.client.update_task(
|
|
395
|
-
project_id=self.project_id,
|
|
396
374
|
task_id=self.task_id,
|
|
397
375
|
name="Updated Task",
|
|
398
376
|
description="Updated Description",
|
|
@@ -407,7 +385,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
407
385
|
self.client.api_service.put.return_value = self.mock_response
|
|
408
386
|
|
|
409
387
|
result = self.client.update_task(
|
|
410
|
-
project_id=self.project_id,
|
|
411
388
|
task_id=self.task_id,
|
|
412
389
|
name="Upserted Task",
|
|
413
390
|
upsert=True
|
|
@@ -424,7 +401,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
424
401
|
|
|
425
402
|
try:
|
|
426
403
|
result = self.client.update_task(
|
|
427
|
-
project_id=self.project_id,
|
|
428
404
|
task_id=self.task_id,
|
|
429
405
|
name="Updated Task"
|
|
430
406
|
)
|
|
@@ -434,16 +410,16 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
434
410
|
self.assertEqual(result, "success text")
|
|
435
411
|
|
|
436
412
|
def test_delete_task_success_with_name(self):
|
|
413
|
+
self.mock_response.status_code = 204
|
|
437
414
|
self.client.api_service.delete.return_value = self.mock_response
|
|
438
415
|
|
|
439
416
|
result = self.client.delete_task(
|
|
440
|
-
project_id=self.project_id,
|
|
441
417
|
task_id="",
|
|
442
418
|
task_name="Test Task"
|
|
443
419
|
)
|
|
444
420
|
|
|
445
421
|
self.client.api_service.delete.assert_called_once()
|
|
446
|
-
self.assertEqual(result, {
|
|
422
|
+
self.assertEqual(result, {})
|
|
447
423
|
|
|
448
424
|
def test_delete_task_json_decode_error(self):
|
|
449
425
|
self.mock_response.json.side_effect = JSONDecodeError("Invalid JSON", "", 0)
|
|
@@ -451,7 +427,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
451
427
|
|
|
452
428
|
try:
|
|
453
429
|
result = self.client.delete_task(
|
|
454
|
-
project_id=self.project_id,
|
|
455
430
|
task_id=self.task_id
|
|
456
431
|
)
|
|
457
432
|
except InvalidAPIResponseException as e:
|
|
@@ -462,7 +437,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
462
437
|
def test_delete_task_missing_identifier(self):
|
|
463
438
|
with self.assertRaises(ValueError) as context:
|
|
464
439
|
self.client.delete_task(
|
|
465
|
-
project_id=self.project_id,
|
|
466
440
|
task_id="",
|
|
467
441
|
task_name=""
|
|
468
442
|
)
|
|
@@ -473,7 +447,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
473
447
|
self.client.api_service.post.return_value = self.mock_response
|
|
474
448
|
|
|
475
449
|
result = self.client.publish_task_revision(
|
|
476
|
-
project_id=self.project_id,
|
|
477
450
|
task_id="",
|
|
478
451
|
task_name="Test Task",
|
|
479
452
|
revision="3"
|
|
@@ -485,7 +458,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
485
458
|
def test_publish_task_revision_missing_identifier(self):
|
|
486
459
|
with self.assertRaises(ValueError) as context:
|
|
487
460
|
self.client.publish_task_revision(
|
|
488
|
-
project_id=self.project_id,
|
|
489
461
|
task_id="", # Explicitly empty to trigger the ValueError
|
|
490
462
|
task_name="", # Explicitly empty to trigger the ValueError
|
|
491
463
|
revision="3"
|
|
@@ -496,7 +468,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
496
468
|
def test_publish_task_revision_missing_revision(self):
|
|
497
469
|
with self.assertRaises(ValueError) as context:
|
|
498
470
|
self.client.publish_task_revision(
|
|
499
|
-
project_id=self.project_id,
|
|
500
471
|
task_id=self.task_id
|
|
501
472
|
)
|
|
502
473
|
|
|
@@ -508,7 +479,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
508
479
|
|
|
509
480
|
try:
|
|
510
481
|
result = self.client.publish_task_revision(
|
|
511
|
-
project_id=self.project_id,
|
|
512
482
|
task_id=self.task_id,
|
|
513
483
|
revision="3"
|
|
514
484
|
)
|
|
@@ -523,7 +493,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
523
493
|
|
|
524
494
|
try:
|
|
525
495
|
result = self.client.start_instance(
|
|
526
|
-
project_id=self.project_id,
|
|
527
496
|
process_name="Test Process"
|
|
528
497
|
)
|
|
529
498
|
except InvalidAPIResponseException as e:
|
|
@@ -535,7 +504,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
535
504
|
self.client.api_service.post.return_value = self.mock_response
|
|
536
505
|
|
|
537
506
|
result = self.client.start_instance(
|
|
538
|
-
project_id=self.project_id,
|
|
539
507
|
process_name="Test Process",
|
|
540
508
|
subject="Test Subject",
|
|
541
509
|
variables=[{"key": "var1", "value": "value1"}]
|
|
@@ -550,7 +518,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
550
518
|
self.client.api_service.post.return_value = self.mock_response
|
|
551
519
|
|
|
552
520
|
result = self.client.abort_instance(
|
|
553
|
-
project_id=self.project_id,
|
|
554
521
|
instance_id=self.instance_id
|
|
555
522
|
)
|
|
556
523
|
|
|
@@ -563,7 +530,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
563
530
|
|
|
564
531
|
try:
|
|
565
532
|
result = self.client.abort_instance(
|
|
566
|
-
project_id=self.project_id,
|
|
567
533
|
instance_id=self.instance_id
|
|
568
534
|
)
|
|
569
535
|
except InvalidAPIResponseException as e:
|
|
@@ -575,7 +541,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
575
541
|
self.client.api_service.get.return_value = self.mock_response
|
|
576
542
|
|
|
577
543
|
result = self.client.get_instance(
|
|
578
|
-
project_id=self.project_id,
|
|
579
544
|
instance_id=self.instance_id
|
|
580
545
|
)
|
|
581
546
|
|
|
@@ -588,7 +553,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
588
553
|
|
|
589
554
|
try:
|
|
590
555
|
result = self.client.get_instance(
|
|
591
|
-
project_id=self.project_id,
|
|
592
556
|
instance_id=self.instance_id
|
|
593
557
|
)
|
|
594
558
|
except InvalidAPIResponseException as e:
|
|
@@ -599,7 +563,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
599
563
|
def test_get_instance_missing_id(self):
|
|
600
564
|
with self.assertRaises(ValueError) as context:
|
|
601
565
|
self.client.get_instance(
|
|
602
|
-
project_id=self.project_id,
|
|
603
566
|
instance_id=""
|
|
604
567
|
)
|
|
605
568
|
|
|
@@ -609,7 +572,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
609
572
|
self.client.api_service.get.return_value = self.mock_response
|
|
610
573
|
|
|
611
574
|
result = self.client.get_instance_history(
|
|
612
|
-
project_id=self.project_id,
|
|
613
575
|
instance_id=self.instance_id
|
|
614
576
|
)
|
|
615
577
|
|
|
@@ -622,7 +584,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
622
584
|
|
|
623
585
|
try:
|
|
624
586
|
result = self.client.get_instance_history(
|
|
625
|
-
project_id=self.project_id,
|
|
626
587
|
instance_id=self.instance_id
|
|
627
588
|
)
|
|
628
589
|
except InvalidAPIResponseException as e:
|
|
@@ -633,7 +594,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
633
594
|
def test_get_instance_history_missing_id(self):
|
|
634
595
|
with self.assertRaises(ValueError) as context:
|
|
635
596
|
self.client.get_instance_history(
|
|
636
|
-
project_id=self.project_id,
|
|
637
597
|
instance_id=""
|
|
638
598
|
)
|
|
639
599
|
|
|
@@ -643,7 +603,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
643
603
|
self.client.api_service.get.return_value = self.mock_response
|
|
644
604
|
|
|
645
605
|
result = self.client.get_thread_information(
|
|
646
|
-
project_id=self.project_id,
|
|
647
606
|
thread_id=self.thread_id
|
|
648
607
|
)
|
|
649
608
|
|
|
@@ -656,7 +615,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
656
615
|
|
|
657
616
|
try:
|
|
658
617
|
result = self.client.get_thread_information(
|
|
659
|
-
project_id=self.project_id,
|
|
660
618
|
thread_id=self.thread_id
|
|
661
619
|
)
|
|
662
620
|
except InvalidAPIResponseException as e:
|
|
@@ -667,7 +625,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
667
625
|
def test_get_thread_information_missing_id(self):
|
|
668
626
|
with self.assertRaises(ValueError) as context:
|
|
669
627
|
self.client.get_thread_information(
|
|
670
|
-
project_id=self.project_id,
|
|
671
628
|
thread_id=""
|
|
672
629
|
)
|
|
673
630
|
|
|
@@ -677,7 +634,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
677
634
|
self.client.api_service.post.return_value = self.mock_response
|
|
678
635
|
|
|
679
636
|
result = self.client.send_user_signal(
|
|
680
|
-
project_id=self.project_id,
|
|
681
637
|
instance_id=self.instance_id,
|
|
682
638
|
signal_name="approval"
|
|
683
639
|
)
|
|
@@ -691,7 +647,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
691
647
|
|
|
692
648
|
try:
|
|
693
649
|
result = self.client.send_user_signal(
|
|
694
|
-
project_id=self.project_id,
|
|
695
650
|
instance_id=self.instance_id,
|
|
696
651
|
signal_name="approval"
|
|
697
652
|
)
|
|
@@ -703,7 +658,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
703
658
|
def test_send_user_signal_missing_instance_id(self):
|
|
704
659
|
with self.assertRaises(ValueError) as context:
|
|
705
660
|
self.client.send_user_signal(
|
|
706
|
-
project_id=self.project_id,
|
|
707
661
|
instance_id="",
|
|
708
662
|
signal_name="approval"
|
|
709
663
|
)
|
|
@@ -716,7 +670,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
716
670
|
|
|
717
671
|
try:
|
|
718
672
|
result = self.client.create_kb(
|
|
719
|
-
project_id=self.project_id,
|
|
720
673
|
name="Test KB"
|
|
721
674
|
)
|
|
722
675
|
except InvalidAPIResponseException as e:
|
|
@@ -728,7 +681,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
728
681
|
self.client.api_service.post.return_value = self.mock_response
|
|
729
682
|
|
|
730
683
|
result = self.client.create_kb(
|
|
731
|
-
project_id=self.project_id,
|
|
732
684
|
name="Test KB",
|
|
733
685
|
artifacts=["art1", "art2"],
|
|
734
686
|
metadata=["meta1", "meta2"]
|
|
@@ -744,7 +696,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
744
696
|
self.client.api_service.get.return_value = self.mock_response
|
|
745
697
|
|
|
746
698
|
result = self.client.get_kb(
|
|
747
|
-
project_id=self.project_id,
|
|
748
699
|
kb_id="",
|
|
749
700
|
kb_name="Test KB"
|
|
750
701
|
)
|
|
@@ -758,7 +709,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
758
709
|
|
|
759
710
|
try:
|
|
760
711
|
result = self.client.get_kb(
|
|
761
|
-
project_id=self.project_id,
|
|
762
712
|
kb_id=self.kb_id
|
|
763
713
|
)
|
|
764
714
|
except InvalidAPIResponseException as e:
|
|
@@ -769,7 +719,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
769
719
|
def test_get_kb_missing_identifier(self):
|
|
770
720
|
with self.assertRaises(ValueError) as context:
|
|
771
721
|
self.client.get_kb(
|
|
772
|
-
project_id=self.project_id,
|
|
773
722
|
kb_id="",
|
|
774
723
|
kb_name=""
|
|
775
724
|
)
|
|
@@ -780,7 +729,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
780
729
|
self.client.api_service.get.return_value = self.mock_response
|
|
781
730
|
|
|
782
731
|
result = self.client.list_kbs(
|
|
783
|
-
project_id=self.project_id,
|
|
784
732
|
name="Test KB",
|
|
785
733
|
start="5",
|
|
786
734
|
count="25"
|
|
@@ -794,25 +742,23 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
794
742
|
self.client.api_service.get.return_value = self.mock_response
|
|
795
743
|
|
|
796
744
|
try:
|
|
797
|
-
result = self.client.list_kbs(
|
|
798
|
-
project_id=self.project_id
|
|
799
|
-
)
|
|
745
|
+
result = self.client.list_kbs()
|
|
800
746
|
except InvalidAPIResponseException as e:
|
|
801
747
|
result = self.mock_response.text
|
|
802
748
|
|
|
803
749
|
self.assertEqual(result, "success text")
|
|
804
750
|
|
|
805
751
|
def test_delete_kb_success_with_name(self):
|
|
752
|
+
self.mock_response.status_code = 204
|
|
806
753
|
self.client.api_service.delete.return_value = self.mock_response
|
|
807
754
|
|
|
808
755
|
result = self.client.delete_kb(
|
|
809
|
-
project_id=self.project_id,
|
|
810
756
|
kb_id="",
|
|
811
757
|
kb_name="Test KB"
|
|
812
758
|
)
|
|
813
759
|
|
|
814
760
|
self.client.api_service.delete.assert_called_once()
|
|
815
|
-
self.assertEqual(result, {
|
|
761
|
+
self.assertEqual(result, {})
|
|
816
762
|
|
|
817
763
|
def test_delete_kb_json_decode_error(self):
|
|
818
764
|
self.mock_response.json.side_effect = JSONDecodeError("Invalid JSON", "", 0)
|
|
@@ -820,7 +766,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
820
766
|
|
|
821
767
|
try:
|
|
822
768
|
result = self.client.delete_kb(
|
|
823
|
-
project_id=self.project_id,
|
|
824
769
|
kb_id=self.kb_id
|
|
825
770
|
)
|
|
826
771
|
except InvalidAPIResponseException as e:
|
|
@@ -831,7 +776,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
831
776
|
def test_delete_kb_missing_identifier(self):
|
|
832
777
|
with self.assertRaises(ValueError) as context:
|
|
833
778
|
self.client.delete_kb(
|
|
834
|
-
project_id=self.project_id,
|
|
835
779
|
kb_id="",
|
|
836
780
|
kb_name=""
|
|
837
781
|
)
|
|
@@ -843,9 +787,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
843
787
|
self.client.api_service.get.return_value = self.mock_response
|
|
844
788
|
|
|
845
789
|
try:
|
|
846
|
-
result = self.client.list_jobs(
|
|
847
|
-
project_id=self.project_id
|
|
848
|
-
)
|
|
790
|
+
result = self.client.list_jobs()
|
|
849
791
|
except InvalidAPIResponseException as e:
|
|
850
792
|
result = self.mock_response.text
|
|
851
793
|
|
|
@@ -855,7 +797,6 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
855
797
|
self.client.api_service.get.return_value = self.mock_response
|
|
856
798
|
|
|
857
799
|
result = self.client.list_jobs(
|
|
858
|
-
project_id=self.project_id,
|
|
859
800
|
start="10",
|
|
860
801
|
count="30",
|
|
861
802
|
topic="test-topic",
|