Skip to content

Commit

Permalink
Merge pull request #88 from axem-solutions/DEM-163
Browse files Browse the repository at this point in the history
list and info command status outputs clarified.
  • Loading branch information
vezdeneszter authored Sep 12, 2023
2 parents 3fc3d31 + 5d9e9b6 commit 389bffa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dem/cli/command/info_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from rich.table import Table

image_status_messages = {
ToolImages.NOT_AVAILABLE: "[red]Error: Image is not available.[/]",
ToolImages.NOT_AVAILABLE: "[red]Error: Required image is not available![/]",
ToolImages.LOCAL_ONLY: "Image is available locally.",
ToolImages.REGISTRY_ONLY: "Image is available in the registry.",
ToolImages.LOCAL_AND_REGISTRY: "Image is available locally and in the registry.",
Expand Down
8 changes: 4 additions & 4 deletions dem/cli/command/list_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(
DEV_ENV_ORG_NOT_IN_REGISTRY,
DEV_ENV_ORG_INSTALLED_LOCALLY,
DEV_ENV_ORG_REAINSTALL,
DEV_ENV_ORG_REINSTALL,
DEV_ENV_ORG_READY,
) = range(4)

Expand All @@ -23,13 +23,13 @@
dev_env_org_status_messages = {
DEV_ENV_ORG_NOT_IN_REGISTRY: "[red]Error: Required image is not available in the registry![/]",
DEV_ENV_ORG_INSTALLED_LOCALLY: "Installed locally.",
DEV_ENV_ORG_REAINSTALL: "Incomplete local install. Reinstall needed.",
DEV_ENV_ORG_REINSTALL: "Incomplete local install. The missing images are available in the registry. Use `dem pull` to reinstall.",
DEV_ENV_ORG_READY: "Ready to be installed.",
}

dev_env_local_status_messages = {
DEV_ENV_LOCAL_NOT_AVAILABLE: "[red]Error: Required image is not available![/]",
DEV_ENV_LOCAL_REINSTALL: "Incopmlete local install. Reinstall needed.",
DEV_ENV_LOCAL_REINSTALL: "Incomplete local install. The missing images are available in the registry. Use `dem pull` to reinstall.",
DEV_ENV_LOCAL_INSTALLED: "Installed.",
}

Expand All @@ -42,7 +42,7 @@ def get_catalog_dev_env_status(platform: DevEnvLocalSetup, dev_env: DevEnv) -> s
dev_env_status = dev_env_org_status_messages[DEV_ENV_ORG_INSTALLED_LOCALLY]
else:
if (platform.get_local_dev_env(dev_env) is not None):
dev_env_status = dev_env_org_status_messages[DEV_ENV_ORG_REAINSTALL]
dev_env_status = dev_env_org_status_messages[DEV_ENV_ORG_REINSTALL]
else:
dev_env_status = dev_env_org_status_messages[DEV_ENV_ORG_READY]
return dev_env_status
Expand Down
4 changes: 2 additions & 2 deletions tests/cli/test_info_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def stub_check_image_availability(*args, **kwargs):
fake_dev_env.check_image_availability.assert_called_once_with(fake_platform.tool_images)

expected_tools = [
["build system", "axemsolutions/bazel:latest", "[red]Error: Image is not available.[/]"],
["toolchain", "axemsolutions/gnu_arm:latest", "[red]Error: Image is not available.[/]"],
["build system", "axemsolutions/bazel:latest", "[red]Error: Required image is not available![/]"],
["toolchain", "axemsolutions/gnu_arm:latest", "[red]Error: Required image is not available![/]"],
["debugger", "axemsolutions/jlink:latest", "Image is available locally."],
["deployer", "axemsolutions/jlink:latest", "Image is available locally."],
["test framework", "axemsolutions/cpputest:latest", "Image is available locally and in the registry."],
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/test_list_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_with_valid_dev_env_org_json(mock_DevEnvLocalSetup):
expected_dev_env_list = [
["org_only_env", "Ready to be installed."],
["demo", "Installed locally."],
["nagy_cica_project", "Incomplete local install. Reinstall needed."],
["nagy_cica_project", "Incomplete local install. The missing images are available in the registry. Use `dem pull` to reinstall."],
["unavailable_image_env", "[red]Error: Required image is not available in the registry![/]"]
]
fake_image_statuses = [
Expand Down

0 comments on commit 389bffa

Please sign in to comment.