Skip to content

Commit

Permalink
feat(dev): removed include users from dump;
Browse files Browse the repository at this point in the history
- Removed include users from dump subcommand and tests.
  • Loading branch information
JVickery-TBS committed Aug 24, 2023
1 parent ba7b2af commit c00a25f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
8 changes: 1 addition & 7 deletions ckanapi/cli/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']:
Expand All @@ -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:
Expand Down Expand Up @@ -267,7 +262,6 @@ def b(name):
+ b('--update-only')
+ b('--upload-resources')
+ b('--upload-logo')
+ b('--include-users')
)


Expand Down
19 changes: 0 additions & 19 deletions ckanapi/tests/test_cli_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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",'
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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",'
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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'
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit c00a25f

Please sign in to comment.