-
Notifications
You must be signed in to change notification settings - Fork 98
Better CLI info for item types #650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 28 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
580711c
First attempt at showing item_types. Issue, don't know the bundle.
kevinlacaille 29ab2d0
Working soluition, but perhaps should exist in planet.clients.data.Da…
kevinlacaille 0ee5357
Changed arg type to the new comma sep. choice.
kevinlacaille 08e0e57
Added new comma separeted choice class. Work in progress. Doesn't dis…
kevinlacaille e00716a
Removed item_type retrieval, added epilog to search functions, replac…
kevinlacaille e07a35a
Removed the CommaSeparatedChoice class.
kevinlacaille 089443b
Added validation to get_match(), moved item_type retrival to get_item…
kevinlacaille 5043b0f
Fixed test - test shouldn't have had a tuple, should have a comma sep…
kevinlacaille 7082c57
Fixed linting.
kevinlacaille 95fc788
Fixed linting.
kevinlacaille 427189e
Undo accidental string change.
kevinlacaille eab311f
Undo accidental string change.
kevinlacaille 60a7377
Added test for epilog.
kevinlacaille 76adcdf
Tests to test the check_item_type callback function in data CLI.
kevinlacaille a6f98db
Fixed broken test, item_type should be a comma sep. string, not a tuple.
kevinlacaille e2056e2
Fixed broken test, item_type should be a comma sep. string, not a tuple.
kevinlacaille 3840db0
Set lowering command in set difference. Otherwise, it makes all item_…
kevinlacaille ba48f62
Fixed linting.
kevinlacaille 02f4860
Undo extra spaces.
kevinlacaille fa8c6fd
Removed copyright 2020 statement, since developed in 2022.
kevinlacaille 2a83f67
Added test for get_item_types without bundle.
kevinlacaille b488cc3
Removed accidentally added extra single quote.
kevinlacaille e0a7572
More explicit in get_item_types and added docs.
kevinlacaille 2417a82
Removed duplicated variables.
kevinlacaille a6c7f80
Improved docs.
kevinlacaille 994931b
Got all item types from planet.specs.get_item_types, not from a test.
kevinlacaille ff259a3
Improved docs.
kevinlacaille 7bd17c1
Improved docs linting.
kevinlacaille 28851ed
Update tests/unit/test_specs.py
kevinlacaille 9ca54c2
Fixed success test not fail on BadParameter.
kevinlacaille File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Copyright 2022 Planet Labs PBC. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| import logging | ||
| import pytest | ||
| import click | ||
| from planet.cli.data import check_item_types | ||
|
|
||
| LOGGER = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| class MockContext: | ||
|
|
||
| def __init__(self): | ||
| self.obj = {} | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("item_type", | ||
| [ | ||
| 'myd09ga', | ||
| 'sentinel1', | ||
| 'rescene', | ||
| 'myd09gq', | ||
| 'psorthotile', | ||
| 'landsat8l1g', | ||
| 'reorthotile', | ||
| 'sentinel2l1c', | ||
| 'skysatscene', | ||
| 'skysatcollect', | ||
| 'mod09ga', | ||
| 'psscene3band', | ||
| 'mod09gq', | ||
| 'psscene4band', | ||
| 'psscene' | ||
| ]) | ||
| def test_item_type_success(item_type): | ||
| ctx = MockContext() | ||
| with pytest.raises(click.BadParameter): | ||
| check_item_types(ctx, 'item_type', item_type) | ||
|
|
||
|
|
||
| def test_item_type_fail(): | ||
| ctx = MockContext() | ||
| with pytest.raises(click.BadParameter): | ||
| check_item_types(ctx, 'item_type', "bad_item_type") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.