Skip to content

Commit

Permalink
Added app-clients get
Browse files Browse the repository at this point in the history
  • Loading branch information
augustak committed Nov 24, 2023
1 parent 2705b22 commit c663ed5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 12.4.0 - 2023-11-24

- Added `app-clients get`

## Version 12.3.0 - 2023-11-20

- Added optional parameter `--email-config` to `workflows create`
Expand Down
2 changes: 1 addition & 1 deletion lascli/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
__maintainer_email__ = 'magnus@lucidtech.ai'
__title__ = 'lucidtech-las-cli'
__url__ = 'https://github.com/LucidtechAI/las-cli'
__version__ = '12.3.0'
__version__ = '12.4.0'
8 changes: 8 additions & 0 deletions lascli/parser/app_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def create_app_client(
)


def get_app_client(las_client: Client, app_client_id):
return las_client.get_app_client(app_client_id)


def list_app_clients(las_client: Client, max_results=None, next_token=None):
return las_client.list_app_clients(max_results=max_results, next_token=next_token)

Expand Down Expand Up @@ -49,6 +53,10 @@ def create_app_clients_parser(subparsers):
create_app_client_parser.add_argument('--role-ids', nargs='+', default=NotProvided)
create_app_client_parser.set_defaults(cmd=create_app_client)

get_app_client_parser = subparsers.add_parser('get')
get_app_client_parser.add_argument('app_client_id')
get_app_client_parser.set_defaults(cmd=get_app_client)

list_app_clients_parser = subparsers.add_parser('list')
list_app_clients_parser.add_argument('--max-results', '-m', type=int, default=None)
list_app_clients_parser.add_argument('--next-token', '-n', default=None)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ PyYAML>=6.0.0
argcomplete>=2.0.0
dateparser>=1.1.1
filetype>=1.0.13
lucidtech-las~=10.2
lucidtech-las~=10.3
12 changes: 10 additions & 2 deletions tests/test_app_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,23 @@ def test_app_clients_update(parser, client, name_and_description, role_ids):
*name_and_description,
*role_ids,
]

if len(args) <= 3: # patch call requires at least one change
with pytest.raises(Exception):
util.main_parser(parser, client, args)
else:
util.main_parser(parser, client, args)


def test_app_clients_get(parser, client):
args = [
'app-clients',
'get',
service.create_app_client_id(),
]
util.main_parser(parser, client, args)


def test_app_clients_list(parser, client, list_defaults):
args = [
'app-clients',
Expand All @@ -71,7 +80,6 @@ def test_app_clients_list(parser, client, list_defaults):
util.main_parser(parser, client, args)


@pytest.mark.skip
def test_app_clients_delete(parser, client):
args = [
'app-clients',
Expand Down

0 comments on commit c663ed5

Please sign in to comment.