Repository: planetlabs/planet-client-python

Issue:
minor CLI updates: Update CLI orders get docstring, remove short name from pretty option
Update the CLI orders get docstring to the string given below and remove the short name from the pretty option.

```
Usage: planet orders get [OPTIONS] ORDER_ID

  Get order

  This command outputs the order description, optionally pretty-printed.

Options:
  --pretty  Format JSON output.
  --help    Show this message and exit.
```

Discussion:

Patch:
diff --git a/planet/cli/orders.py b/planet/cli/orders.py
index 2d0aac3..c2a8e2b 100644
--- a/planet/cli/orders.py
+++ b/planet/cli/orders.py
@@ -26,8 +26,7 @@ from .io import echo_json
 
 LOGGER = logging.getLogger(__name__)
 
-pretty = click.option('-pp', '--pretty', is_flag=True,
-                      help='Format JSON output')
+pretty = click.option('--pretty', is_flag=True, help='Format JSON output')
 
 
 @asynccontextmanager
@@ -76,7 +75,10 @@ async def list(ctx, state, limit, pretty):
 @click.argument('order_id', type=click.UUID)
 @pretty
 async def get(ctx, order_id, pretty):
-    '''Get order by order ID.'''
+    """Get order
+
+    This command outputs the order description, optionally pretty-printed.
+    """
     async with orders_client(ctx) as cl:
         order = await cl.get_order(str(order_id))
 
@@ -117,11 +119,12 @@ async def download(ctx, order_id, quiet, overwrite, dest):
         with planet.reporting.StateBar(order_id=order_id,
                                        disable=quiet) as bar:
             await cl.poll(str(order_id), report=bar.update)
-            _ = await cl.download_order(
+            filenames = await cl.download_order(
                     str(order_id),
                     directory=dest,
                     overwrite=overwrite,
                     progress_bar=not quiet)
+    click.echo(f'Downloaded {len(filenames)} files.')
 
 
 def split_id_list(ctx, param, value):


Test patch:
diff --git a/tests/integration/test_orders_cli.py b/tests/integration/test_orders_cli.py
index f56be7d..32d140d 100644
--- a/tests/integration/test_orders_cli.py
+++ b/tests/integration/test_orders_cli.py
@@ -237,8 +237,10 @@ def test_cli_orders_download(invoke, mock_download_response, oid):
         result = invoke(['download', oid], runner=runner)
         assert not result.exception
 
-        # no message, output is only progress reporting
-        assert result.output.startswith('\r00:00 - order')
+        # output is progress reporting plus the message
+        message = 'Downloaded 2 files.\n'
+        assert message in result.output
+        assert message != result.output
 
         # Check that the files were downloaded and have the correct contents
         f1_path = Path(folder) / 'm1.json'
diff --git a/tests/unit/test_cli_io.py b/tests/unit/test_cli_io.py
index b3db238..8037713 100644
--- a/tests/unit/test_cli_io.py
+++ b/tests/unit/test_cli_io.py
@@ -11,7 +11,7 @@
 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 # License for the specific language governing permissions and limitations under
 # the License.
-from unittest.mock import patch
+from unittest.mock import Mock
 
 import pytest
 
@@ -21,8 +21,10 @@ from planet.cli import io
 @pytest.mark.parametrize(
     "pretty,expected",
     [(False, '{"key": "val"}'), (True, '{\n  "key": "val"\n}')])
-@patch('planet.cli.io.click.echo')
-def test_cli_echo_json(mock_echo, pretty, expected):
+def test_cli_echo_json(pretty, expected, monkeypatch):
+    mock_echo = Mock()
+    monkeypatch.setattr(io.click, 'echo', mock_echo)
+
     obj = {'key': 'val'}
     io.echo_json(obj, pretty)
     mock_echo.assert_called_once_with(expected)