testzeus-cli 0.0.23__tar.gz → 0.0.25__tar.gz

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.
Files changed (37) hide show
  1. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/PKG-INFO +1 -1
  2. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/pyproject.toml +1 -1
  3. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/environments.py +93 -38
  4. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_data.py +3 -18
  5. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/LICENSE +0 -0
  6. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/README.md +0 -0
  7. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/__init__.py +0 -0
  8. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/auth.py +0 -0
  9. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/cli.py +0 -0
  10. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/__init__.py +0 -0
  11. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/daemon.py +0 -0
  12. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/device_pool.py +0 -0
  13. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/extensions.py +0 -0
  14. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/hypermind_code_blocks.py +0 -0
  15. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/knowledge_bases.py +0 -0
  16. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/notification_channels.py +0 -0
  17. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/tags.py +0 -0
  18. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_report_schedules.py +0 -0
  19. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_run_groups.py +0 -0
  20. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_runs.py +0 -0
  21. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_suite_node_runs.py +0 -0
  22. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_suite_runs.py +0 -0
  23. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_suite_schedules.py +0 -0
  24. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_suites.py +0 -0
  25. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/tests.py +0 -0
  26. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/tests_ai_generator.py +0 -0
  27. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/tests_authoring.py +0 -0
  28. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/commands/user_integrations.py +0 -0
  29. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/config.py +0 -0
  30. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/utils/__init__.py +0 -0
  31. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/utils/auth.py +0 -0
  32. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/utils/client.py +0 -0
  33. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/utils/files.py +0 -0
  34. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/utils/formatters.py +0 -0
  35. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/utils/links.py +0 -0
  36. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/utils/profile.py +0 -0
  37. {testzeus_cli-0.0.23 → testzeus_cli-0.0.25}/testzeus_cli/utils/validators.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: testzeus-cli
3
- Version: 0.0.23
3
+ Version: 0.0.25
4
4
  Summary: Command-line interface for TestZeus testing platform
5
5
  License-File: LICENSE
6
6
  Author: Shriyansh Agnihotri
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "testzeus-cli"
7
- version = "0.0.23"
7
+ version = "0.0.25"
8
8
  description = "Command-line interface for TestZeus testing platform"
9
9
  authors = ["Shriyansh Agnihotri <shriyansh@testzeus.com>"]
10
10
  readme = "README.md"
@@ -3,6 +3,7 @@ Environment management commands for TestZeus CLI.
3
3
  """
4
4
 
5
5
  import asyncio
6
+ import builtins
6
7
  import json
7
8
  import click
8
9
  from pathlib import Path
@@ -52,14 +53,27 @@ def _validate_and_serialize_data(raw_data: str) -> str:
52
53
  raise click.BadParameter(str(e))
53
54
 
54
55
 
55
- def _validate_device_type_options(device_type, file, mobile_file, connected_environments):
56
- """Validate CLI options against device_type constraints."""
56
+ def _validate_device_type_options(
57
+ device_type, file, mobile_file, connected_environments, mobile_device=None
58
+ ):
59
+ """Validate CLI options against device_type constraints.
60
+
61
+ browser: --file / --connected-environments allowed;
62
+ --mobile-file / --mobile-device forbidden.
63
+ mobile-*: --mobile-file / --mobile-device allowed;
64
+ --file / --connected-environments forbidden.
65
+ """
57
66
  if device_type == "browser":
58
67
  if mobile_file:
59
68
  raise click.UsageError(
60
69
  "--mobile-file cannot be used with --device-type=browser. "
61
70
  "Use --file for browser environments."
62
71
  )
72
+ if mobile_device:
73
+ raise click.UsageError(
74
+ "--mobile-device cannot be used with --device-type=browser. "
75
+ "It is only valid for mobile-android/mobile-ios."
76
+ )
63
77
  elif device_type in MOBILE_DEVICE_TYPES:
64
78
  if file:
65
79
  raise click.UsageError(
@@ -72,6 +86,40 @@ def _validate_device_type_options(device_type, file, mobile_file, connected_envi
72
86
  )
73
87
 
74
88
 
89
+ def _filter_environment_output(data: dict) -> dict:
90
+ """Omit fields that do not apply to the environment's device_type."""
91
+ if not isinstance(data, dict):
92
+ return data
93
+ device_type = data.get("device_type") or "browser"
94
+ filtered = dict(data)
95
+ if device_type in MOBILE_DEVICE_TYPES:
96
+ filtered.pop("supporting_data_files", None)
97
+ filtered.pop("supporting_data_files_info", None)
98
+ filtered.pop("connected_environments", None)
99
+ filtered.pop("browser_auth_file", None)
100
+ filtered.pop("browser_auth_file_info", None)
101
+ filtered.pop("email_manager", None)
102
+ else:
103
+ filtered.pop("mobile_supporting_data_file", None)
104
+ filtered.pop("mobile_supporting_data_file_info", None)
105
+ filtered.pop("mobile_device", None)
106
+ return filtered
107
+
108
+
109
+ def _filter_environment_list_output(result):
110
+ """Filter list payloads (dict with items or raw list) by device_type."""
111
+ # builtins.list: this module's Click command is named `list` and shadows
112
+ # the builtin at runtime when isinstance() is evaluated.
113
+ if isinstance(result, dict) and isinstance(result.get("items"), builtins.list):
114
+ return {
115
+ **result,
116
+ "items": [_filter_environment_output(item) for item in result["items"]],
117
+ }
118
+ if isinstance(result, builtins.list):
119
+ return [_filter_environment_output(item) for item in result]
120
+ return _filter_environment_output(result)
121
+
122
+
75
123
  @click.group()
76
124
  def environments_group():
77
125
  """Manage environments in TestZeus"""
@@ -86,9 +134,6 @@ def environments_group():
86
134
  default="browser",
87
135
  help="Device type (default: browser)",
88
136
  )
89
- @click.option(
90
- "--status", default="draft", help="Environment status (draft, ready, deleted)"
91
- )
92
137
  @click.option("--data", help=DATA_FORMAT_HELP)
93
138
  @click.option(
94
139
  "--data-file",
@@ -112,6 +157,10 @@ def environments_group():
112
157
  type=click.Path(exists=True),
113
158
  help="Path to mobile app file - APK/ZIP (mobile only)",
114
159
  )
160
+ @click.option(
161
+ "--mobile-device",
162
+ help="Device pool ID or device_name (mobile only; use 'device-pool list' to discover)",
163
+ )
115
164
  @click.option(
116
165
  "--email-manager",
117
166
  help="Comma-separated list of email manager integration IDs or names (browser only)",
@@ -124,12 +173,8 @@ def environments_group():
124
173
  "--agent-grounding-prompt",
125
174
  help="Agent grounding prompt (JSON string)",
126
175
  )
127
- @click.option(
128
- "--device-config",
129
- help="Device configuration (JSON string)",
130
- )
131
176
  @click.pass_context
132
- def create(ctx, name, device_type, status, data, data_file, tags, connected_environments, file, mobile_file, email_manager, source_code_integrations, agent_grounding_prompt, device_config):
177
+ def create(ctx, name, device_type, data, data_file, tags, connected_environments, file, mobile_file, mobile_device, email_manager, source_code_integrations, agent_grounding_prompt):
133
178
  """Create a new environment"""
134
179
 
135
180
  if data and data_file:
@@ -139,7 +184,9 @@ def create(ctx, name, device_type, status, data, data_file, tags, connected_envi
139
184
  if not is_mobile and not data and not data_file:
140
185
  raise click.UsageError("Either --data or --data-file is required for browser environments")
141
186
 
142
- _validate_device_type_options(device_type, file, mobile_file, connected_environments)
187
+ _validate_device_type_options(
188
+ device_type, file, mobile_file, connected_environments, mobile_device=mobile_device
189
+ )
143
190
 
144
191
  data_content = None
145
192
  if data_file:
@@ -163,7 +210,6 @@ def create(ctx, name, device_type, status, data, data_file, tags, connected_envi
163
210
  params = {
164
211
  "name": name,
165
212
  "device_type": device_type,
166
- "status": status,
167
213
  "tenant": stored_tenant_id,
168
214
  "modified_by": stored_user_id,
169
215
  "metadata": "{}",
@@ -178,6 +224,9 @@ def create(ctx, name, device_type, status, data, data_file, tags, connected_envi
178
224
  if connected_environments:
179
225
  params["connected_environments"] = connected_environments.split(",")
180
226
 
227
+ if mobile_device:
228
+ params["mobile_device"] = mobile_device
229
+
181
230
  if email_manager:
182
231
  params["email_manager"] = email_manager.split(",")
183
232
 
@@ -187,9 +236,6 @@ def create(ctx, name, device_type, status, data, data_file, tags, connected_envi
187
236
  if agent_grounding_prompt:
188
237
  params["agent_grounding_prompt"] = agent_grounding_prompt
189
238
 
190
- if device_config:
191
- params["device_config"] = device_config
192
-
193
239
  if file:
194
240
  try:
195
241
  params["supporting_data_files"] = FileUpload(file, open(file, "rb"))
@@ -205,7 +251,7 @@ def create(ctx, name, device_type, status, data, data_file, tags, connected_envi
205
251
  exit(1)
206
252
 
207
253
  env = await client.environments.create(params)
208
- return env.data
254
+ return _filter_environment_output(env.data)
209
255
 
210
256
  try:
211
257
  result = asyncio.run(_run())
@@ -246,7 +292,7 @@ def list(ctx, filters, sort, expand):
246
292
  try:
247
293
  result = asyncio.run(_run())
248
294
  print_platform_link(ctx, "environments")
249
- format_output(result, ctx.obj["FORMAT"])
295
+ format_output(_filter_environment_list_output(result), ctx.obj["FORMAT"])
250
296
  except Exception as e:
251
297
  print_message(f"[red]Error listing environments: {str(e)}[/red]", ctx.obj["FORMAT"])
252
298
  raise click.Abort()
@@ -301,7 +347,7 @@ def get(ctx, env_id, expand):
301
347
  else:
302
348
  await client.ensure_authenticated()
303
349
  env = await client.environments.get_one(env_id, expand=expand)
304
- return env.data
350
+ return _filter_environment_output(env.data)
305
351
 
306
352
  try:
307
353
  result = asyncio.run(_run())
@@ -320,7 +366,6 @@ def get(ctx, env_id, expand):
320
366
  type=click.Choice(["browser", "mobile-android", "mobile-ios"]),
321
367
  help="Device type",
322
368
  )
323
- @click.option("--status", help="New environment status (draft, ready, deleted)")
324
369
  @click.option("--data", help=DATA_FORMAT_HELP)
325
370
  @click.option(
326
371
  "--data-file",
@@ -344,6 +389,10 @@ def get(ctx, env_id, expand):
344
389
  type=click.Path(exists=True),
345
390
  help="Path to mobile app file - APK/ZIP (mobile only)",
346
391
  )
392
+ @click.option(
393
+ "--mobile-device",
394
+ help="Device pool ID or device_name (mobile only; use 'none' to clear)",
395
+ )
347
396
  @click.option(
348
397
  "--email-manager",
349
398
  help="Comma-separated list of email manager integration IDs or names (browser only, use 'none' to clear)",
@@ -356,19 +405,23 @@ def get(ctx, env_id, expand):
356
405
  "--agent-grounding-prompt",
357
406
  help="Agent grounding prompt (JSON string, use 'none' to clear)",
358
407
  )
359
- @click.option(
360
- "--device-config",
361
- help="Device configuration (JSON string, use 'none' to clear)",
362
- )
363
408
  @click.pass_context
364
- def update(ctx, env_id, name, device_type, status, data, data_file, tags, connected_environments, file, mobile_file, email_manager, source_code_integrations, agent_grounding_prompt, device_config):
409
+ def update(ctx, env_id, name, device_type, data, data_file, tags, connected_environments, file, mobile_file, mobile_device, email_manager, source_code_integrations, agent_grounding_prompt):
365
410
  """Update an environment"""
366
411
 
367
412
  if data and data_file:
368
413
  raise click.UsageError("Cannot use both --data and --data-file")
369
414
 
415
+ # Treat 'none' as a clear request for validation purposes (still mobile-only)
416
+ mobile_device_for_validation = None if mobile_device == "none" else mobile_device
370
417
  if device_type:
371
- _validate_device_type_options(device_type, file, mobile_file, connected_environments)
418
+ _validate_device_type_options(
419
+ device_type,
420
+ file,
421
+ mobile_file,
422
+ connected_environments,
423
+ mobile_device=mobile_device_for_validation,
424
+ )
372
425
 
373
426
  data_content = None
374
427
  if data_file:
@@ -392,7 +445,13 @@ def update(ctx, env_id, name, device_type, status, data, data_file, tags, connec
392
445
  validate_tenant_ownership(env.data, tenant_id, "environment")
393
446
 
394
447
  effective_device_type = device_type or env.device_type
395
- _validate_device_type_options(effective_device_type, file, mobile_file, connected_environments)
448
+ _validate_device_type_options(
449
+ effective_device_type,
450
+ file,
451
+ mobile_file,
452
+ connected_environments,
453
+ mobile_device=mobile_device_for_validation,
454
+ )
396
455
 
397
456
  updates = {"tenant": tenant_id, "modified_by": user_id}
398
457
  has_updates = False
@@ -405,10 +464,6 @@ def update(ctx, env_id, name, device_type, status, data, data_file, tags, connec
405
464
  updates["device_type"] = device_type
406
465
  has_updates = True
407
466
 
408
- if status:
409
- updates["status"] = status
410
- has_updates = True
411
-
412
467
  if data_content:
413
468
  updates["data"] = data_content
414
469
  has_updates = True
@@ -428,6 +483,13 @@ def update(ctx, env_id, name, device_type, status, data, data_file, tags, connec
428
483
  updates["connected_environments"] = connected_environments.split(",")
429
484
  has_updates = True
430
485
 
486
+ if mobile_device:
487
+ if mobile_device == "none":
488
+ updates["mobile_device"] = None
489
+ else:
490
+ updates["mobile_device"] = mobile_device
491
+ has_updates = True
492
+
431
493
  if email_manager:
432
494
  if email_manager == "none":
433
495
  updates["email_manager"] = None
@@ -449,13 +511,6 @@ def update(ctx, env_id, name, device_type, status, data, data_file, tags, connec
449
511
  updates["agent_grounding_prompt"] = agent_grounding_prompt
450
512
  has_updates = True
451
513
 
452
- if device_config:
453
- if device_config == "none":
454
- updates["device_config"] = None
455
- else:
456
- updates["device_config"] = device_config
457
- has_updates = True
458
-
459
514
  if file:
460
515
  try:
461
516
  updates["supporting_data_files"] = FileUpload(
@@ -478,7 +533,7 @@ def update(ctx, env_id, name, device_type, status, data, data_file, tags, connec
478
533
 
479
534
  if has_updates:
480
535
  updated_env = await client.environments.update(env_id, updates)
481
- return updated_env.data
536
+ return _filter_environment_output(updated_env.data)
482
537
  else:
483
538
  print_message("[yellow]No updates provided[/yellow]", ctx.obj["FORMAT"])
484
539
  return None
@@ -123,10 +123,6 @@ def get_test_data(ctx, test_data_id, expand):
123
123
 
124
124
  @test_data_group.command(name="create")
125
125
  @click.option("--name", required=True, help="Test data name")
126
- @click.option("--type", default="test", help="Test data type")
127
- @click.option(
128
- "--status", default="draft", help="Test data status (draft, ready, deleted)"
129
- )
130
126
  @click.option("--data", "-d", help=DATA_FORMAT_HELP)
131
127
  @click.option(
132
128
  "--data-file",
@@ -141,7 +137,7 @@ def get_test_data(ctx, test_data_id, expand):
141
137
  help="Path to supporting data file to upload",
142
138
  )
143
139
  @click.pass_context
144
- def create_test_data(ctx, name, type, status, data, data_file, file):
140
+ def create_test_data(ctx, name, data, data_file, file):
145
141
  """Create new test data"""
146
142
 
147
143
  if not data and not data_file:
@@ -161,8 +157,7 @@ def create_test_data(ctx, name, type, status, data, data_file, file):
161
157
 
162
158
  test_data = {
163
159
  "name": name,
164
- "type": type,
165
- "status": status,
160
+ "type": "test",
166
161
  "data": data_content,
167
162
  "tenant": tenant_id,
168
163
  "modified_by": user_id,
@@ -196,8 +191,6 @@ def create_test_data(ctx, name, type, status, data, data_file, file):
196
191
  @test_data_group.command(name="update")
197
192
  @click.argument("test_data_id")
198
193
  @click.option("--name", help="New test data name")
199
- @click.option("--type", help="New test data type")
200
- @click.option("--status", help="New test data status (draft, ready, deleted)")
201
194
  @click.option("--data", "-d", help=DATA_FORMAT_HELP)
202
195
  @click.option(
203
196
  "--data-file",
@@ -212,7 +205,7 @@ def create_test_data(ctx, name, type, status, data, data_file, file):
212
205
  help="Path to supporting data file to upload",
213
206
  )
214
207
  @click.pass_context
215
- def update_test_data(ctx, test_data_id, name, type, status, data, data_file, file):
208
+ def update_test_data(ctx, test_data_id, name, data, data_file, file):
216
209
  """Update an existing test data"""
217
210
 
218
211
  if data and data_file:
@@ -253,14 +246,6 @@ def update_test_data(ctx, test_data_id, name, type, status, data, data_file, fil
253
246
  updates["name"] = name
254
247
  has_updates = True
255
248
 
256
- if type:
257
- updates["type"] = type
258
- has_updates = True
259
-
260
- if status:
261
- updates["status"] = status
262
- has_updates = True
263
-
264
249
  # Process input data (either from input or file)
265
250
  if data_content:
266
251
  updates["data"] = data_content
File without changes
File without changes