osducli 0.0.42__tar.gz → 0.0.43__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {osducli-0.0.42/src/osducli.egg-info → osducli-0.0.43}/PKG-INFO +11 -1
- {osducli-0.0.42 → osducli-0.0.43}/README.rst +6 -0
- {osducli-0.0.42 → osducli-0.0.43}/pyproject.toml +5 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/__init__.py +1 -1
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/cliclient.py +5 -1
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/storage/add.py +45 -29
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/storage/delete.py +6 -5
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/util/file.py +18 -0
- {osducli-0.0.42 → osducli-0.0.43/src/osducli.egg-info}/PKG-INFO +11 -1
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli.egg-info/requires.txt +4 -0
- {osducli-0.0.42 → osducli-0.0.43}/tests/test_cliclient.py +8 -2
- {osducli-0.0.42 → osducli-0.0.43}/LICENSE.md +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/setup.cfg +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/__main__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/auth/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/auth/aws_token_credential.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/auth/credentials.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/auth/msal_interactive.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/auth/msal_non_interactive.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/auth/token_credential.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/click_cli.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/config/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/config/consts.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/config/default.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/config/info.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/config/list.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/config/update.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/crs/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/crs/_const.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/crs/areas.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/crs/info.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/crs/list.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/crs/summary.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/crs/transforms.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/dataload/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/dataload/checkrefs.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/dataload/ingest.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/dataload/status.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/dataload/verify.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/entitlements/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/entitlements/_const.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/entitlements/groups/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/entitlements/groups/add.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/entitlements/groups/delete.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/entitlements/groups/members.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/entitlements/info.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/entitlements/members/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/entitlements/members/add.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/entitlements/members/groups.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/entitlements/members/list.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/entitlements/members/remove.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/entitlements/mygroups.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/file/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/file/_const.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/file/download.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/file/info.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/file/metadata.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/legal/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/legal/_const.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/legal/add.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/legal/delete.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/legal/info.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/legal/listtags.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/list/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/list/records.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/schema/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/schema/_const.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/schema/add.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/schema/get.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/schema/info.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/schema/list.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/search/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/search/_const.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/search/id.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/search/info.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/search/kind.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/search/query.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/status/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/status/status.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/storage/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/storage/_const.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/storage/get.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/storage/info.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/storage/list.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/storage/versions.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/unit/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/unit/_const.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/unit/info.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/unit/list.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/version/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/version/version.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/wellbore_ddms/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/wellbore_ddms/_const.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/wellbore_ddms/info.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/wellbore_ddms/well_log/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/wellbore_ddms/well_log/data.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/wellbore_ddms/well_log/record.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/workflow/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/workflow/_const.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/workflow/get.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/workflow/info.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/workflow/list.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/workflow/register.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/workflow/runs.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/workflow/status.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/commands/workflow/unregister.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/config.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/log.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/state.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/util/__init__.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/util/exceptions.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/util/prompt.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/util/pypi.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/util/service_info.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli/wbddms_client.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli.egg-info/SOURCES.txt +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli.egg-info/dependency_links.txt +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli.egg-info/entry_points.txt +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/src/osducli.egg-info/top_level.txt +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/tests/test_click_cli_state.py +0 -0
- {osducli-0.0.42 → osducli-0.0.43}/tests/test_help_text.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: osducli
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.43
|
|
4
4
|
Summary: OSDU command line
|
|
5
5
|
Author-email: Equinor ASA <mhew@equinor.com>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -26,6 +26,10 @@ Requires-Dist: msal-extensions
|
|
|
26
26
|
Requires-Dist: azure-identity
|
|
27
27
|
Requires-Dist: azure-keyvault
|
|
28
28
|
Requires-Dist: boto3
|
|
29
|
+
Requires-Dist: google
|
|
30
|
+
Requires-Dist: google-auth
|
|
31
|
+
Requires-Dist: google-auth-oauthlib
|
|
32
|
+
Requires-Dist: google-cloud-storage
|
|
29
33
|
Provides-Extra: dev
|
|
30
34
|
Requires-Dist: black; extra == "dev"
|
|
31
35
|
Requires-Dist: isort; extra == "dev"
|
|
@@ -79,6 +83,12 @@ For more information, specify the `-h` flag:
|
|
|
79
83
|
Change Log
|
|
80
84
|
==========
|
|
81
85
|
|
|
86
|
+
0.0.43
|
|
87
|
+
------
|
|
88
|
+
|
|
89
|
+
- Fix storage add command
|
|
90
|
+
- Implement storage add batching
|
|
91
|
+
|
|
82
92
|
0.0.42
|
|
83
93
|
------
|
|
84
94
|
|
|
@@ -274,7 +274,11 @@ class CliOsduClient(BaseClient):
|
|
|
274
274
|
requests.Response: Response object from the HTTP call
|
|
275
275
|
"""
|
|
276
276
|
url = self.url_from_config(config_url_key, url_extra_path)
|
|
277
|
-
|
|
277
|
+
|
|
278
|
+
# TODO: Fix bug in SDK for DELETE. Workaround is to give bearer_token
|
|
279
|
+
response = self.make_request(method=HttpMethod.DELETE, url=url,
|
|
280
|
+
bearer_token=self.token_refresher.refresh_token())
|
|
281
|
+
|
|
278
282
|
self.check_status_code(response, ok_status_codes)
|
|
279
283
|
return response
|
|
280
284
|
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
import json
|
|
16
16
|
|
|
17
17
|
import click
|
|
18
|
+
from osdu_api.model.storage.record import Record
|
|
18
19
|
|
|
19
20
|
from osducli.click_cli import CustomClickCommand, State, command_with_output
|
|
20
21
|
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
21
|
-
from osducli.config import CONFIG_STORAGE_URL
|
|
22
22
|
from osducli.log import get_logger
|
|
23
|
-
from osducli.util.file import
|
|
23
|
+
from osducli.util.file import get_files_from_path_with_suffix
|
|
24
24
|
|
|
25
25
|
logger = get_logger(__name__)
|
|
26
26
|
|
|
@@ -51,41 +51,57 @@ def _click_command(state: State, path: str, batch: int):
|
|
|
51
51
|
return add_records(state, path, batch)
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
def add_records(state: State, path: str, batch: int
|
|
54
|
+
def add_records(state: State, path: str, batch: int = None):
|
|
55
55
|
"""Add or update a record
|
|
56
56
|
|
|
57
57
|
Args:
|
|
58
58
|
state (State): Global state
|
|
59
59
|
path (str): Path to a record or records to add.
|
|
60
60
|
batch (int): Batch size per API call. If None then ingest as is
|
|
61
|
-
Returns:
|
|
62
|
-
dict: Response from service
|
|
63
61
|
"""
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
connection = CliOsduClient(state.config)
|
|
62
|
+
client = CliOsduClient(state.config)
|
|
63
|
+
record_client = client.get_storage_record_client()
|
|
68
64
|
|
|
69
|
-
files =
|
|
65
|
+
files = get_files_from_path_with_suffix(path, ".json")
|
|
70
66
|
logger.debug("Files list: %s", files)
|
|
71
67
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
if batch is not None:
|
|
69
|
+
logger.info("Batching records with size %s", batch)
|
|
70
|
+
file_batches = chunk_list(files, batch)
|
|
71
|
+
for file_batch in file_batches:
|
|
72
|
+
response = add_record_batch(record_client, file_batch)
|
|
73
|
+
handle_response(client, response)
|
|
74
|
+
else:
|
|
75
|
+
response = add_record_batch(record_client, files)
|
|
76
|
+
handle_response(client, response)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def add_record_batch(record_client, files):
|
|
80
|
+
record_list = []
|
|
75
81
|
for filepath in files:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
with open(filepath, encoding="utf-8") as file:
|
|
83
|
+
storage_object = json.load(file)
|
|
84
|
+
|
|
85
|
+
logger.info("Processing file %s.", filepath)
|
|
86
|
+
record_list.append(Record.from_dict(storage_object))
|
|
87
|
+
|
|
88
|
+
return record_client.create_update_records(record_list)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def chunk_list(lst, size):
|
|
92
|
+
return [lst[i:i + size] for i in range(0, len(lst), size)]
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def handle_response(client, response):
|
|
96
|
+
client.check_status_code(response, [200, 201])
|
|
97
|
+
response_json = response.json()
|
|
98
|
+
count = response_json["recordCount"]
|
|
99
|
+
added = response_json["recordIds"]
|
|
100
|
+
skipped = response_json.get("skippedRecordIds", [])
|
|
101
|
+
|
|
102
|
+
print(f"Record count: {count}")
|
|
103
|
+
print(json.dumps(added, indent=2))
|
|
104
|
+
|
|
105
|
+
if skipped:
|
|
106
|
+
print("Skipped records:")
|
|
107
|
+
print(json.dumps(skipped, indent=2))
|
|
@@ -10,13 +10,12 @@
|
|
|
10
10
|
# See the License for the specific language governing permissions and
|
|
11
11
|
# limitations under the License.
|
|
12
12
|
|
|
13
|
-
"""Storage service
|
|
13
|
+
"""Storage service delete command"""
|
|
14
14
|
|
|
15
15
|
import click
|
|
16
16
|
|
|
17
17
|
from osducli.click_cli import CustomClickCommand, State, global_params
|
|
18
18
|
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
19
|
-
from osducli.config import CONFIG_STORAGE_URL
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
# click entry point
|
|
@@ -36,9 +35,11 @@ def delete(state: State, id: str): # pylint: disable=invalid-name,redefined-bui
|
|
|
36
35
|
state (State): Global state
|
|
37
36
|
id (str): id to delete
|
|
38
37
|
"""
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
client = CliOsduClient(state.config)
|
|
39
|
+
record_client = client.get_storage_record_client()
|
|
40
|
+
# TODO: Fix bug in SDK for DELETE. Workaround is to give bearer_token
|
|
41
|
+
response = record_client.delete_record(recordId=id, bearer_token=client.token_refresher.refresh_token())
|
|
42
|
+
client.check_status_code(response, [200, 204])
|
|
42
43
|
|
|
43
44
|
if state.is_user_friendly_mode():
|
|
44
45
|
print("1 record deleted")
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import errno
|
|
14
14
|
import os
|
|
15
|
+
import glob
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
def get_files_from_path(path: str) -> list:
|
|
@@ -34,6 +35,23 @@ def get_files_from_path(path: str) -> list:
|
|
|
34
35
|
return allfiles
|
|
35
36
|
|
|
36
37
|
|
|
38
|
+
def get_files_from_path_with_suffix(path: str, suffix: str) -> list:
|
|
39
|
+
"""Given a path get a list of all files with a certain suffix.
|
|
40
|
+
|
|
41
|
+
Args:
|
|
42
|
+
path (str): path
|
|
43
|
+
suffix (str): file suffix to filter by
|
|
44
|
+
|
|
45
|
+
Returns:
|
|
46
|
+
list: list of file paths
|
|
47
|
+
"""
|
|
48
|
+
if os.path.isfile(path):
|
|
49
|
+
return [path] if path.endswith(suffix) else []
|
|
50
|
+
|
|
51
|
+
pattern = os.path.join(path, '**', f'*{suffix}')
|
|
52
|
+
return glob.glob(pattern, recursive=True)
|
|
53
|
+
|
|
54
|
+
|
|
37
55
|
def ensure_directory_exists(directory: str):
|
|
38
56
|
"""Create a directory if it doesn't exist"""
|
|
39
57
|
if not os.path.isdir(directory):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: osducli
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.43
|
|
4
4
|
Summary: OSDU command line
|
|
5
5
|
Author-email: Equinor ASA <mhew@equinor.com>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -26,6 +26,10 @@ Requires-Dist: msal-extensions
|
|
|
26
26
|
Requires-Dist: azure-identity
|
|
27
27
|
Requires-Dist: azure-keyvault
|
|
28
28
|
Requires-Dist: boto3
|
|
29
|
+
Requires-Dist: google
|
|
30
|
+
Requires-Dist: google-auth
|
|
31
|
+
Requires-Dist: google-auth-oauthlib
|
|
32
|
+
Requires-Dist: google-cloud-storage
|
|
29
33
|
Provides-Extra: dev
|
|
30
34
|
Requires-Dist: black; extra == "dev"
|
|
31
35
|
Requires-Dist: isort; extra == "dev"
|
|
@@ -79,6 +83,12 @@ For more information, specify the `-h` flag:
|
|
|
79
83
|
Change Log
|
|
80
84
|
==========
|
|
81
85
|
|
|
86
|
+
0.0.43
|
|
87
|
+
------
|
|
88
|
+
|
|
89
|
+
- Fix storage add command
|
|
90
|
+
- Implement storage add batching
|
|
91
|
+
|
|
82
92
|
0.0.42
|
|
83
93
|
------
|
|
84
94
|
|
|
@@ -205,11 +205,14 @@ def test_cli_delete(mocker, cli_client, config, path):
|
|
|
205
205
|
response_mock = Mock()
|
|
206
206
|
response_mock.status_code = 200
|
|
207
207
|
mock_delete = mocker.patch.object(cli_client, "make_request", return_value=response_mock)
|
|
208
|
+
mock_token_refresher = mocker.Mock()
|
|
209
|
+
mock_token_refresher.refresh_token.return_value = "some-token"
|
|
210
|
+
cli_client.token_refresher = mock_token_refresher
|
|
208
211
|
|
|
209
212
|
response = cli_client.cli_delete(config, path)
|
|
210
213
|
|
|
211
214
|
mock_delete.assert_called_once()
|
|
212
|
-
mock_delete.assert_called_with(method=HttpMethod.DELETE, url="https://dummy.com/core_" + config + path)
|
|
215
|
+
mock_delete.assert_called_with(method=HttpMethod.DELETE, url="https://dummy.com/core_" + config + path, bearer_token="some-token")
|
|
213
216
|
assert response_mock == response
|
|
214
217
|
|
|
215
218
|
@pytest.mark.parametrize("ok_status_codes, actual_status_code",
|
|
@@ -224,11 +227,14 @@ def test_cli_delete_status_codes(mocker, cli_client, ok_status_codes, actual_sta
|
|
|
224
227
|
response_mock = Mock()
|
|
225
228
|
response_mock.status_code = actual_status_code
|
|
226
229
|
mock_delete = mocker.patch.object(cli_client, "make_request", return_value=response_mock)
|
|
230
|
+
mock_token_refresher = mocker.Mock()
|
|
231
|
+
mock_token_refresher.refresh_token.return_value = "some-token"
|
|
232
|
+
cli_client.token_refresher = mock_token_refresher
|
|
227
233
|
|
|
228
234
|
response = cli_client.cli_delete("config", "/path", ok_status_codes)
|
|
229
235
|
|
|
230
236
|
mock_delete.assert_called_once()
|
|
231
|
-
mock_delete.assert_called_with(method=HttpMethod.DELETE, url="https://dummy.com/core_config/path")
|
|
237
|
+
mock_delete.assert_called_with(method=HttpMethod.DELETE, url="https://dummy.com/core_config/path", bearer_token="some-token")
|
|
232
238
|
assert response_mock == response
|
|
233
239
|
|
|
234
240
|
# endregion test cli_delete
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|