Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions elyra/metadata/metadata_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@ def print_help(self):
class SchemaspaceUpdate(SchemaspaceCreate):
"""Handles the 'update' subcommand functionality for a specific schemaspace."""

# Unlike on create, the name can't be derived from the display name since it identifies
# the existing instance.
name_option = CliOption(
"--name", name="name", description="The name of the metadata instance to update.", required=True
)

update_mode = True


Expand Down
18 changes: 12 additions & 6 deletions elyra/tests/metadata/test_metadata_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,8 @@ def test_update_no_schema_single(script_runner, mock_data_dir):
# Note: this test will break if it ever supports multiple.
ret = script_runner.run("elyra-metadata", "update", "runtime-images")
assert ret.success is False
assert (
"The following exception occurred saving metadata instance for schema 'runtime-image': "
"The 'name' parameter requires a value." in ret.stdout
)
assert "ERROR: '--name' is a required parameter." in ret.stdout
assert "The following exception occurred" not in ret.stdout


def test_update_no_schema_multiple(script_runner, mock_data_dir):
Expand All @@ -418,10 +416,18 @@ def test_update_bad_schema_multiple(script_runner, mock_data_dir):
def test_update_no_name(script_runner, mock_data_dir):
ret = script_runner.run("elyra-metadata", "update", METADATA_TEST_SCHEMASPACE, "--schema_name=metadata-test")
assert ret.success is False
assert "ERROR: '--name' is a required parameter." in ret.stdout
assert (
"The following exception occurred saving metadata instance for schema 'metadata-test': "
"The 'name' parameter requires a value." in ret.stdout
"--name=<string> (Required. Format: sequence of characters) \n\tThe name of the metadata instance to update."
in ret.stdout
)
assert "The following exception occurred" not in ret.stdout

ret = script_runner.run(
"elyra-metadata", "update", METADATA_TEST_SCHEMASPACE, "--schema_name=metadata-test", "--name="
)
assert ret.success is False
assert "ERROR: Parameter '--name' requires a value." in ret.stdout


def test_update_no_instance(script_runner, mock_data_dir):
Expand Down
Loading