Skip to content

Commit

Permalink
Add testing of 'collection create mapped'
Browse files Browse the repository at this point in the history
This primarily consists of a new set of tests which exercise the
command exactly as written. One thing this revealed right away was
that the CLI output from mapped collection creation was missing most
of the useful fields to inspect. To remedy this, the command was
updated with the "standard_collection_fields".
  • Loading branch information
sirosen committed Dec 13, 2023
1 parent 421bacd commit a891dd7
Show file tree
Hide file tree
Showing 2 changed files with 396 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/globus_cli/commands/collection/create/mapped.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import click
import globus_sdk

from globus_cli.commands.collection._common import (
filter_fields,
standard_collection_fields,
)
from globus_cli.constants import ExplicitNullType
from globus_cli.login_manager import LoginManager
from globus_cli.parsing import (
Expand All @@ -15,7 +19,7 @@
endpoint_id_arg,
endpointish_params,
)
from globus_cli.termio import Field, TextMode, display
from globus_cli.termio import TextMode, display


def _make_multi_use_option_str(s: str) -> str:
Expand Down Expand Up @@ -292,4 +296,9 @@ def collection_create_mapped(
)
res = gcs_client.create_collection(collection_doc)

display(res, text_mode=TextMode.text_record, fields=[Field("Collection ID", "id")])
fields = standard_collection_fields(login_manager.get_auth_client())
display(
res,
text_mode=TextMode.text_record,
fields=filter_fields(fields, res),
)
Loading

0 comments on commit a891dd7

Please sign in to comment.