From c00a25f950436572e81bde62f76b7d1a1a819bed Mon Sep 17 00:00:00 2001 From: Jesse Vickery Date: Thu, 24 Aug 2023 18:58:17 +0000 Subject: [PATCH] feat(dev): removed include users from dump; - Removed include users from dump subcommand and tests. --- ckanapi/cli/load.py | 8 +------- ckanapi/tests/test_cli_load.py | 19 ------------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/ckanapi/cli/load.py b/ckanapi/cli/load.py index a920e75..9ee8b2d 100644 --- a/ckanapi/cli/load.py +++ b/ckanapi/cli/load.py @@ -174,11 +174,6 @@ def reply(action, error, response): if arguments['--insecure']: requests_kwargs = {'verify': False} - include_users = False - if '--include-users' in arguments \ - and arguments['--include-users']: - include_users = True - if obj is not None: existing = None if not arguments['--create-only']: @@ -190,7 +185,7 @@ def reply(action, error, response): {'id': name, 'include_datasets': False, 'include_password_hash': True, - 'include_users': include_users, + 'include_users': True, }, requests_kwargs=requests_kwargs) except NotFound: @@ -267,7 +262,6 @@ def b(name): + b('--update-only') + b('--upload-resources') + b('--upload-logo') - + b('--include-users') ) diff --git a/ckanapi/tests/test_cli_load.py b/ckanapi/tests/test_cli_load.py index 970e93f..af6b132 100644 --- a/ckanapi/tests/test_cli_load.py +++ b/ckanapi/tests/test_cli_load.py @@ -69,7 +69,6 @@ def test_create_with_no_resources(self): '--update-only': False, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO(b'{"name": "45","title":"Forty-five"}\n'), stdout=self.stdout) @@ -86,7 +85,6 @@ def test_create_with_corrupted_resources(self): '--update-only': False, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO(b'{"name": "45","title":"Forty-five","resources":[{"id":"123"}]}\n'), stdout=self.stdout) @@ -103,7 +101,6 @@ def test_create_with_complete_resources(self): '--update-only': False, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO( b'{"name": "45","title":"Forty-five",' @@ -122,7 +119,6 @@ def test_create_only(self): '--update-only': False, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO(b'{"name": "45","title":"Forty-five"}\n'), stdout=self.stdout) @@ -139,7 +135,6 @@ def test_create_empty_dict(self): '--update-only': False, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO(b'{}\n'), stdout=self.stdout) @@ -155,7 +150,6 @@ def test_create_bad_option(self): '--create-only': False, '--update-only': True, '--insecure': False, - '--include-users': False, }, stdin=BytesIO(b'{"name": "45","title":"Forty-five"}\n'), stdout=self.stdout) @@ -171,7 +165,6 @@ def test_update_with_no_resources(self): '--create-only': False, '--update-only': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO(b'{"name": "30ish","title":"3.4 times ten"}\n'), stdout=self.stdout) @@ -188,7 +181,6 @@ def test_update_with_corrupted_resources(self): '--update-only': False, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO(b'{"name": "30ish","title":"3.4 times ten","resources":[{"id":"123"}]}\n'), stdout=self.stdout) @@ -205,7 +197,6 @@ def test_update_with_complete_resources(self): '--update-only': False, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO( b'{"name": "30ish","title":"3.4 times ten",' @@ -224,7 +215,6 @@ def test_update_only(self): '--update-only': True, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO(b'{"name": "34","title":"3.4 times ten"}\n'), stdout=self.stdout) @@ -241,7 +231,6 @@ def test_update_bad_option(self): '--update-only': False, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO(b'{"name": "34","title":"3.4 times ten"}\n'), stdout=self.stdout) @@ -258,7 +247,6 @@ def test_update_unauthorized(self): '--update-only': False, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO(b'{"name": "seekrit", "title": "Things"}\n'), stdout=self.stdout) @@ -275,7 +263,6 @@ def test_update_group(self): '--update-only': False, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO(b'{"id": "ab","title":"a balloon"}\n'), stdout=self.stdout) @@ -292,7 +279,6 @@ def test_update_organization_two(self): '--update-only': False, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO( b'{"name": "cd", "title": "Go"}\n' @@ -317,7 +303,6 @@ def test_update_organization_with_users_unchanged(self): '--update-only': False, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO(b'{"id": "used", "title": "here"}\n'), stdout=self.stdout) @@ -334,7 +319,6 @@ def test_update_organization_with_users_cleared(self): '--update-only': False, '--upload-resources': False, '--insecure': False, - '--include-users': False, }, stdin=BytesIO(b'{"id": "unused", "users": []}\n'), stdout=self.stdout) @@ -364,7 +348,6 @@ def test_parent_load_two(self): '--upload-resources': False, '--upload-logo': False, '--insecure': False, - '--include-users': False, }, worker_pool=self._mock_worker_pool, stdin=BytesIO( @@ -400,7 +383,6 @@ def test_parent_load_start_max(self): '--upload-resources': False, '--upload-logo': False, '--insecure': False, - '--include-users': False, }, worker_pool=self._mock_worker_pool, stdin=BytesIO( @@ -439,7 +421,6 @@ def test_parent_parallel_limit(self): '--upload-resources': False, '--upload-logo': False, '--insecure': False, - '--include-users': False, }, worker_pool=self._mock_worker_pool, stdin=BytesIO(