zipher-sdk 0.1.7__tar.gz → 0.2.0__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.
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/PKG-INFO +1 -1
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/setup.py +1 -1
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/tests/test_client.py +10 -0
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/zipher/client.py +4 -1
- zipher-sdk-0.2.0/zipher/conf.py +6 -0
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/zipher_sdk.egg-info/PKG-INFO +1 -1
- zipher-sdk-0.1.7/zipher/conf.py +0 -6
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/LICENSE +0 -0
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/README.md +0 -0
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/setup.cfg +0 -0
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/tests/__init__.py +0 -0
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/zipher/__init__.py +0 -0
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/zipher/exceptions.py +0 -0
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/zipher/models.py +0 -0
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/zipher_sdk.egg-info/SOURCES.txt +0 -0
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/zipher_sdk.egg-info/dependency_links.txt +0 -0
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/zipher_sdk.egg-info/requires.txt +0 -0
- {zipher-sdk-0.1.7 → zipher-sdk-0.2.0}/zipher_sdk.egg-info/top_level.txt +0 -0
|
@@ -8,7 +8,7 @@ with open('README.md', encoding='utf-8') as f:
|
|
|
8
8
|
|
|
9
9
|
setup(
|
|
10
10
|
name='zipher-sdk',
|
|
11
|
-
version='0.
|
|
11
|
+
version='0.2.0',
|
|
12
12
|
description='Python SDK for programmatic access to the Zipher API',
|
|
13
13
|
long_description=long_description,
|
|
14
14
|
long_description_content_type='text/markdown',
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import unittest
|
|
2
2
|
from unittest.mock import patch, MagicMock
|
|
3
|
+
|
|
4
|
+
import requests.exceptions
|
|
5
|
+
|
|
3
6
|
from zipher.client import Client
|
|
4
7
|
from zipher.exceptions import MissingAPIKeyError
|
|
5
8
|
from zipher.models import ConfFetcherRequest
|
|
@@ -39,6 +42,13 @@ class TestClient(unittest.TestCase):
|
|
|
39
42
|
with self.assertRaises(ConnectionError):
|
|
40
43
|
self.client.get_optimized_config(job_id="1234")
|
|
41
44
|
|
|
45
|
+
@patch('requests.get')
|
|
46
|
+
def test_api_error_on_cluster_update(self, mock_get):
|
|
47
|
+
mock_get.side_effect = requests.exceptions.ConnectionError
|
|
48
|
+
config_to_update = {'attr': 'value'}
|
|
49
|
+
res = self.client.update_existing_conf(job_id="1234", existing_conf=config_to_update)
|
|
50
|
+
self.assertDictEqual(config_to_update, res)
|
|
51
|
+
|
|
42
52
|
|
|
43
53
|
if __name__ == '__main__':
|
|
44
54
|
unittest.main()
|
|
@@ -42,4 +42,7 @@ class Client:
|
|
|
42
42
|
if 'new_cluster' in existing_conf:
|
|
43
43
|
existing_conf = existing_conf['new_cluster']
|
|
44
44
|
params = ConfFetcherRequest(customer_id=self.customer_id, job_id=job_id, merge_with=json.dumps(existing_conf))
|
|
45
|
-
|
|
45
|
+
try:
|
|
46
|
+
return self._call_conf_fetcher_api(params)
|
|
47
|
+
except:
|
|
48
|
+
return existing_conf
|
zipher-sdk-0.1.7/zipher/conf.py
DELETED
|
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
|