Skip to content

Commit 3b12621

Browse files
Merge pull request #900 from planetlabs/update-subscriptions-cli-describe-878
Update Subscriptions CLI describe function naming
2 parents 1b12987 + 262aa4f commit 3b12621

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

planet/cli/subscriptions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ async def update_subscription_cmd(ctx, subscription_id, request, pretty):
113113
echo_json(sub, pretty)
114114

115115

116-
@subscriptions.command(name='describe')
116+
@subscriptions.command(name='get')
117117
@click.argument('subscription_id')
118118
@pretty
119119
@click.pass_context
120120
@translate_exceptions
121121
@coro
122-
async def describe_subscription_cmd(ctx, subscription_id, pretty):
123-
"""Gets the description of a subscription and prints the API response."""
122+
async def get_subscription_cmd(ctx, subscription_id, pretty):
123+
"""Get the description of a subscription."""
124124
async with subscriptions_client(ctx) as client:
125125
sub = await client.get_subscription(subscription_id)
126126
echo_json(sub, pretty)

tests/integration/test_subscriptions_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ def modify_response(request):
9393
method='POST').mock(side_effect=modify_response)
9494

9595
# Mock the subscription description API endpoint.
96-
describe_mock = respx.mock()
97-
describe_mock.route(
96+
get_mock = respx.mock()
97+
get_mock.route(
9898
M(url=f'{TEST_URL}/test'),
9999
method='GET').mock(return_value=Response(200,
100100
json={
@@ -247,7 +247,7 @@ async def test_get_subscription_failure():
247247

248248

249249
@pytest.mark.anyio
250-
@describe_mock
250+
@get_mock
251251
async def test_get_subscription_success(monkeypatch):
252252
"""Subscription description fetched, has the expected items."""
253253
async with Session() as session:

tests/integration/test_subscriptions_cli.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
There are 6 subscriptions commands:
44
55
[x] planet subscriptions list
6-
[x] planet subscriptions describe
6+
[x] planet subscriptions get
77
[x] planet subscriptions results
88
[x] planet subscriptions create
99
[x] planet subscriptions update
@@ -24,7 +24,7 @@
2424
create_mock,
2525
update_mock,
2626
cancel_mock,
27-
describe_mock,
27+
get_mock,
2828
res_api_mock,
2929
TEST_URL)
3030

@@ -192,10 +192,10 @@ def test_subscriptions_update_success(invoke):
192192

193193

194194
@failing_api_mock
195-
def test_subscriptions_describe_failure(invoke):
195+
def test_subscriptions_get_failure(invoke):
196196
"""Describe command exits gracefully from an API error."""
197197
result = invoke(
198-
['describe', 'test'],
198+
['get', 'test'],
199199
# Note: catch_exceptions=True (the default) is required if we want
200200
# to exercise the "translate_exceptions" decorator and test for
201201
# failure.
@@ -204,11 +204,11 @@ def test_subscriptions_describe_failure(invoke):
204204
assert result.exit_code == 1 # failure.
205205

206206

207-
@describe_mock
208-
def test_subscriptions_describe_success(invoke):
207+
@get_mock
208+
def test_subscriptions_get_success(invoke):
209209
"""Describe command succeeds."""
210210
result = invoke(
211-
['describe', 'test'],
211+
['get', 'test'],
212212
# Note: catch_exceptions=True (the default) is required if we want
213213
# to exercise the "translate_exceptions" decorator and test for
214214
# failure.

0 commit comments

Comments
 (0)