ibm-appconfiguration-python-sdk 0.3.6__tar.gz → 0.3.8__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.
- {ibm_appconfiguration_python_sdk-0.3.6/ibm_appconfiguration_python_sdk.egg-info → ibm_appconfiguration_python_sdk-0.3.8}/PKG-INFO +15 -8
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/README.md +1 -6
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/appconfiguration.py +12 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/configuration_handler.py +14 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/models/rule.py +31 -7
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/version.py +1 -1
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8/ibm_appconfiguration_python_sdk.egg-info}/PKG-INFO +15 -8
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/setup.py +1 -1
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/models/test_rule.py +55 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/LICENSE +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/examples/__init__.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/examples/sample_app.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/examples/server_sample.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/__init__.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/__init__.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/__init__.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/common/__init__.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/common/config_constants.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/common/config_messages.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/utils/__init__.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/utils/api_manager.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/utils/compute_percentage.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/utils/connectivity.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/utils/file_manager.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/utils/logger.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/utils/metering.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/utils/socket.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/utils/url_builder.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/internal/utils/validators.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/models/__init__.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/models/configuration_type.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/models/feature.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/models/property.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/models/segment.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration/configurations/models/segment_rules.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration_python_sdk.egg-info/SOURCES.txt +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration_python_sdk.egg-info/dependency_links.txt +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration_python_sdk.egg-info/requires.txt +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/ibm_appconfiguration_python_sdk.egg-info/top_level.txt +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/integration_tests/__init__.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/integration_tests/test_integration.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/setup.cfg +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/__init__.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/__init__.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/models/__init__.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/models/test_feature.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/models/test_property.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/models/test_segment.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/models/test_segment_rules.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/test_configuration_handler.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/utils/__init__.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/utils/test_api_manager.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/utils/test_file_manager.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/utils/test_metering.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/utils/test_socket.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/configurations/utils/test_url_builder.py +0 -0
- {ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/unit_tests/test_appconfiguration.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: ibm-appconfiguration-python-sdk
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.8
|
|
4
4
|
Summary: IBM Cloud App Configuration Python SDK
|
|
5
5
|
Home-page: https://github.com/IBM/appconfiguration-python-sdk
|
|
6
6
|
Author: IBM
|
|
@@ -21,6 +21,18 @@ Requires-Dist: ibm-cloud-sdk-core<4.0.0,>=3.20.3
|
|
|
21
21
|
Requires-Dist: pyyaml>=5.4.1
|
|
22
22
|
Requires-Dist: schema>=0.7.5
|
|
23
23
|
Requires-Dist: mmh3==5.0.1
|
|
24
|
+
Dynamic: author
|
|
25
|
+
Dynamic: author-email
|
|
26
|
+
Dynamic: classifier
|
|
27
|
+
Dynamic: description
|
|
28
|
+
Dynamic: description-content-type
|
|
29
|
+
Dynamic: home-page
|
|
30
|
+
Dynamic: keywords
|
|
31
|
+
Dynamic: license
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
Dynamic: summary
|
|
24
36
|
|
|
25
37
|
# IBM Cloud App Configuration Python server SDK
|
|
26
38
|
|
|
@@ -74,12 +86,7 @@ The **`init()`** and **`set_context()`** are the initialisation methods and shou
|
|
|
74
86
|
appconfig_client. The appconfig_client, once initialised, can be obtained across modules
|
|
75
87
|
using **`AppConfiguration.get_instance()`**. [See this example below](#fetching-the-appconfig_client-across-other-modules).
|
|
76
88
|
|
|
77
|
-
- region : Region name where the App Configuration service instance is created.
|
|
78
|
-
- `AppConfiguration.REGION_US_SOUTH` for Dallas
|
|
79
|
-
- `AppConfiguration.REGION_EU_GB` for London
|
|
80
|
-
- `AppConfiguration.REGION_AU_SYD` for Sydney
|
|
81
|
-
- `AppConfiguration.REGION_US_EAST` for Washington DC
|
|
82
|
-
- `AppConfiguration.REGION_EU_DE` for Frankfurt
|
|
89
|
+
- region : Region name where the App Configuration service instance is created. See list of supported locations [here](https://cloud.ibm.com/catalog/services/app-configuration). Eg:- `us-south`, `au-syd` etc.
|
|
83
90
|
- guid : GUID of the App Configuration service. Obtain it from the service credentials section of the dashboard
|
|
84
91
|
- apikey : ApiKey of the App Configuration service. Obtain it from the service credentials section of the dashboard
|
|
85
92
|
- collection_id : Id of the collection created in App Configuration service instance under the **Collections** section.
|
|
@@ -50,12 +50,7 @@ The **`init()`** and **`set_context()`** are the initialisation methods and shou
|
|
|
50
50
|
appconfig_client. The appconfig_client, once initialised, can be obtained across modules
|
|
51
51
|
using **`AppConfiguration.get_instance()`**. [See this example below](#fetching-the-appconfig_client-across-other-modules).
|
|
52
52
|
|
|
53
|
-
- region : Region name where the App Configuration service instance is created.
|
|
54
|
-
- `AppConfiguration.REGION_US_SOUTH` for Dallas
|
|
55
|
-
- `AppConfiguration.REGION_EU_GB` for London
|
|
56
|
-
- `AppConfiguration.REGION_AU_SYD` for Sydney
|
|
57
|
-
- `AppConfiguration.REGION_US_EAST` for Washington DC
|
|
58
|
-
- `AppConfiguration.REGION_EU_DE` for Frankfurt
|
|
53
|
+
- region : Region name where the App Configuration service instance is created. See list of supported locations [here](https://cloud.ibm.com/catalog/services/app-configuration). Eg:- `us-south`, `au-syd` etc.
|
|
59
54
|
- guid : GUID of the App Configuration service. Obtain it from the service credentials section of the dashboard
|
|
60
55
|
- apikey : ApiKey of the App Configuration service. Obtain it from the service credentials section of the dashboard
|
|
61
56
|
- collection_id : Id of the collection created in App Configuration service instance under the **Collections** section.
|
|
@@ -39,6 +39,9 @@ class AppConfiguration:
|
|
|
39
39
|
REGION_AU_SYD = "au-syd"
|
|
40
40
|
REGION_US_EAST = "us-east"
|
|
41
41
|
REGION_EU_DE = "eu-de"
|
|
42
|
+
REGION_CA_TOR = "ca-tor"
|
|
43
|
+
REGION_JP_TOK = "jp-tok"
|
|
44
|
+
REGION_JP_OSA = "jp-osa"
|
|
42
45
|
__override_service_url = None
|
|
43
46
|
__use_private_endpoint = False
|
|
44
47
|
|
|
@@ -295,3 +298,12 @@ class AppConfiguration:
|
|
|
295
298
|
return self.__configuration_handler_instance.get_property(property_id)
|
|
296
299
|
Logger.error(config_messages.COLLECTION_INIT_ERROR)
|
|
297
300
|
return None
|
|
301
|
+
|
|
302
|
+
def is_connected(self) -> bool:
|
|
303
|
+
""" Get the status of server-client connection
|
|
304
|
+
|
|
305
|
+
Returns: boolean indicating connection status
|
|
306
|
+
"""
|
|
307
|
+
if self.__configuration_handler_instance is None:
|
|
308
|
+
return False
|
|
309
|
+
return self.__configuration_handler_instance.is_connected()
|
|
@@ -46,6 +46,9 @@ class ConfigurationHandler:
|
|
|
46
46
|
"""Internal class to handle the configuration"""
|
|
47
47
|
__instance = None
|
|
48
48
|
|
|
49
|
+
# variable to keep track of server-client connection status
|
|
50
|
+
__is_alive = False
|
|
51
|
+
|
|
49
52
|
@staticmethod
|
|
50
53
|
def get_instance():
|
|
51
54
|
""" Static access method. """
|
|
@@ -538,24 +541,35 @@ class ConfigurationHandler:
|
|
|
538
541
|
def __on_web_socket_callback(self, message=None, error_state=None,
|
|
539
542
|
closed_state=None, open_state=None):
|
|
540
543
|
if message:
|
|
544
|
+
self.__is_alive = True
|
|
541
545
|
self.__fetch_from_api()
|
|
542
546
|
Logger.debug(f'Received message from socket. {message}')
|
|
543
547
|
elif error_state:
|
|
548
|
+
self.__is_alive = False
|
|
544
549
|
Logger.error(f'Received error from socket. {error_state}')
|
|
545
550
|
Logger.info('Reconnecting to server....')
|
|
546
551
|
self.__on_socket_retry = True
|
|
547
552
|
sleep(delay)
|
|
548
553
|
self.__start_web_socket()
|
|
549
554
|
elif closed_state:
|
|
555
|
+
self.__is_alive = False
|
|
550
556
|
Logger.error('Received close connection from socket.')
|
|
551
557
|
Logger.info('Reconnecting to server....')
|
|
552
558
|
self.__on_socket_retry = True
|
|
553
559
|
sleep(delay)
|
|
554
560
|
self.__start_web_socket()
|
|
555
561
|
elif open_state:
|
|
562
|
+
self.__is_alive = True
|
|
556
563
|
if self.__on_socket_retry:
|
|
557
564
|
self.__on_socket_retry = False
|
|
558
565
|
self.__fetch_from_api()
|
|
559
566
|
Logger.debug('Received opened connection from socket.')
|
|
560
567
|
else:
|
|
561
568
|
Logger.error('Unknown Error inside the socket connection.')
|
|
569
|
+
|
|
570
|
+
def is_connected(self) -> bool:
|
|
571
|
+
""" Get the status of server-client connection
|
|
572
|
+
|
|
573
|
+
Returns: boolean indicating connection status
|
|
574
|
+
"""
|
|
575
|
+
return self.__is_alive
|
|
@@ -45,18 +45,30 @@ class Rule:
|
|
|
45
45
|
def __ends_with(self, key, value) -> bool:
|
|
46
46
|
return key.endswith(value)
|
|
47
47
|
|
|
48
|
+
def __not_ends_with(self, key, value) -> bool:
|
|
49
|
+
return not key.endswith(value)
|
|
50
|
+
|
|
48
51
|
def __starts_with(self, key, value) -> bool:
|
|
49
52
|
return key.startswith(value)
|
|
50
53
|
|
|
54
|
+
def __not_starts_with(self, key, value) -> bool:
|
|
55
|
+
return not key.startswith(value)
|
|
56
|
+
|
|
51
57
|
def __contains(self, key, value) -> bool:
|
|
52
58
|
return value in key
|
|
53
59
|
|
|
60
|
+
def __not_contains(self, key, value) -> bool:
|
|
61
|
+
return not value in key
|
|
62
|
+
|
|
54
63
|
def __is(self, key, value) -> bool:
|
|
55
64
|
if type(key) is type(value):
|
|
56
65
|
return key == value
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
return str(key) == str(value)
|
|
67
|
+
|
|
68
|
+
def __is_not(self, key, value) -> bool:
|
|
69
|
+
if type(key) is type(value):
|
|
70
|
+
return key != value
|
|
71
|
+
return str(key) != str(value)
|
|
60
72
|
|
|
61
73
|
def __greater_than(self, key, value) -> bool:
|
|
62
74
|
|
|
@@ -102,9 +114,13 @@ class Rule:
|
|
|
102
114
|
|
|
103
115
|
case_checker = {
|
|
104
116
|
"endsWith": self.__ends_with,
|
|
117
|
+
"notEndsWith": self.__not_ends_with,
|
|
105
118
|
"startsWith": self.__starts_with,
|
|
119
|
+
"notStartsWith": self.__not_starts_with,
|
|
106
120
|
"contains": self.__contains,
|
|
121
|
+
"notContains": self.__not_contains,
|
|
107
122
|
"is": self.__is,
|
|
123
|
+
"isNot": self.__is_not,
|
|
108
124
|
"greaterThan": self.__greater_than,
|
|
109
125
|
"lesserThan": self.__lesser_than,
|
|
110
126
|
"greaterThanEquals": self.__greater_than_equals,
|
|
@@ -130,9 +146,17 @@ class Rule:
|
|
|
130
146
|
key = entity_attributes.get(self.__attribute_name)
|
|
131
147
|
else:
|
|
132
148
|
return result
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
149
|
+
|
|
150
|
+
if self.__operator in ["isNot", "notContains", "notStartsWith", "notEndsWith"]:
|
|
151
|
+
result = True
|
|
152
|
+
for i in range(0, len(self.__values)):
|
|
153
|
+
value = self.__values[i]
|
|
154
|
+
if not self.__operator_check(key, value):
|
|
155
|
+
result = False
|
|
156
|
+
else:
|
|
157
|
+
for i in range(0, len(self.__values)):
|
|
158
|
+
value = self.__values[i]
|
|
159
|
+
if self.__operator_check(key, value):
|
|
160
|
+
result = True
|
|
137
161
|
|
|
138
162
|
return result
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: ibm-appconfiguration-python-sdk
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.8
|
|
4
4
|
Summary: IBM Cloud App Configuration Python SDK
|
|
5
5
|
Home-page: https://github.com/IBM/appconfiguration-python-sdk
|
|
6
6
|
Author: IBM
|
|
@@ -21,6 +21,18 @@ Requires-Dist: ibm-cloud-sdk-core<4.0.0,>=3.20.3
|
|
|
21
21
|
Requires-Dist: pyyaml>=5.4.1
|
|
22
22
|
Requires-Dist: schema>=0.7.5
|
|
23
23
|
Requires-Dist: mmh3==5.0.1
|
|
24
|
+
Dynamic: author
|
|
25
|
+
Dynamic: author-email
|
|
26
|
+
Dynamic: classifier
|
|
27
|
+
Dynamic: description
|
|
28
|
+
Dynamic: description-content-type
|
|
29
|
+
Dynamic: home-page
|
|
30
|
+
Dynamic: keywords
|
|
31
|
+
Dynamic: license
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
Dynamic: summary
|
|
24
36
|
|
|
25
37
|
# IBM Cloud App Configuration Python server SDK
|
|
26
38
|
|
|
@@ -74,12 +86,7 @@ The **`init()`** and **`set_context()`** are the initialisation methods and shou
|
|
|
74
86
|
appconfig_client. The appconfig_client, once initialised, can be obtained across modules
|
|
75
87
|
using **`AppConfiguration.get_instance()`**. [See this example below](#fetching-the-appconfig_client-across-other-modules).
|
|
76
88
|
|
|
77
|
-
- region : Region name where the App Configuration service instance is created.
|
|
78
|
-
- `AppConfiguration.REGION_US_SOUTH` for Dallas
|
|
79
|
-
- `AppConfiguration.REGION_EU_GB` for London
|
|
80
|
-
- `AppConfiguration.REGION_AU_SYD` for Sydney
|
|
81
|
-
- `AppConfiguration.REGION_US_EAST` for Washington DC
|
|
82
|
-
- `AppConfiguration.REGION_EU_DE` for Frankfurt
|
|
89
|
+
- region : Region name where the App Configuration service instance is created. See list of supported locations [here](https://cloud.ibm.com/catalog/services/app-configuration). Eg:- `us-south`, `au-syd` etc.
|
|
83
90
|
- guid : GUID of the App Configuration service. Obtain it from the service credentials section of the dashboard
|
|
84
91
|
- apikey : ApiKey of the App Configuration service. Obtain it from the service credentials section of the dashboard
|
|
85
92
|
- collection_id : Id of the collection created in App Configuration service instance under the **Collections** section.
|
|
@@ -56,6 +56,17 @@ class MyTestCase(unittest.TestCase):
|
|
|
56
56
|
}
|
|
57
57
|
self.assertFalse(self.sut.evaluate_rule(client_attributes))
|
|
58
58
|
|
|
59
|
+
def test_evaluation_not_ends_with_string(self):
|
|
60
|
+
self.set_up_email('google.com', 'email', 'notEndsWith')
|
|
61
|
+
client_attributes = {
|
|
62
|
+
'email': 'tester@in.ibm.com'
|
|
63
|
+
}
|
|
64
|
+
self.assertTrue(self.sut.evaluate_rule(client_attributes))
|
|
65
|
+
client_attributes = {
|
|
66
|
+
'email': 'tester@google.com'
|
|
67
|
+
}
|
|
68
|
+
self.assertFalse(self.sut.evaluate_rule(client_attributes))
|
|
69
|
+
|
|
59
70
|
def test_evaluation_is(self):
|
|
60
71
|
self.set_up_email("123", "creditValues", "is")
|
|
61
72
|
client_attributes = {
|
|
@@ -99,6 +110,31 @@ class MyTestCase(unittest.TestCase):
|
|
|
99
110
|
self.set_up_email(False, "creditValues", "is")
|
|
100
111
|
self.assertTrue(self.sut.evaluate_rule(client_attributes))
|
|
101
112
|
|
|
113
|
+
def test_evaluation_is_not(self):
|
|
114
|
+
self.set_up_email("123", "creditValues", "isNot")
|
|
115
|
+
client_attributes = {
|
|
116
|
+
'creditValues': '1234'
|
|
117
|
+
}
|
|
118
|
+
self.assertTrue(self.sut.evaluate_rule(client_attributes))
|
|
119
|
+
|
|
120
|
+
self.set_up_email("1234", "creditValues", "isNot")
|
|
121
|
+
client_attributes = {
|
|
122
|
+
'creditValues': 123
|
|
123
|
+
}
|
|
124
|
+
self.assertTrue(self.sut.evaluate_rule(client_attributes))
|
|
125
|
+
|
|
126
|
+
client_attributes = {
|
|
127
|
+
'creditValues': 123
|
|
128
|
+
}
|
|
129
|
+
self.set_up_email(5123, "creditValues", "isNot")
|
|
130
|
+
self.assertTrue(self.sut.evaluate_rule(client_attributes))
|
|
131
|
+
|
|
132
|
+
client_attributes = {
|
|
133
|
+
'creditValues': False
|
|
134
|
+
}
|
|
135
|
+
self.set_up_email(True, "creditValues", "isNot")
|
|
136
|
+
self.assertTrue(self.sut.evaluate_rule(client_attributes))
|
|
137
|
+
|
|
102
138
|
def test_evaluation_startswith(self):
|
|
103
139
|
self.set_up_email('user1', 'email', 'startsWith')
|
|
104
140
|
client_attributes = {
|
|
@@ -106,6 +142,13 @@ class MyTestCase(unittest.TestCase):
|
|
|
106
142
|
}
|
|
107
143
|
self.assertTrue(self.sut.evaluate_rule(client_attributes))
|
|
108
144
|
|
|
145
|
+
def test_evaluation_not_startswith(self):
|
|
146
|
+
self.set_up_email('user2', 'email', 'notStartsWith')
|
|
147
|
+
client_attributes = {
|
|
148
|
+
'email': 'user1@gm.com'
|
|
149
|
+
}
|
|
150
|
+
self.assertTrue(self.sut.evaluate_rule(client_attributes))
|
|
151
|
+
|
|
109
152
|
def test_evaluation_contains(self):
|
|
110
153
|
self.set_up_email('+91', 'mobile', 'contains')
|
|
111
154
|
client_attributes = {
|
|
@@ -118,6 +161,18 @@ class MyTestCase(unittest.TestCase):
|
|
|
118
161
|
}
|
|
119
162
|
self.assertFalse(self.sut.evaluate_rule(client_attributes))
|
|
120
163
|
|
|
164
|
+
def test_evaluation_not_contains(self):
|
|
165
|
+
self.set_up_email('+91', 'mobile', 'notContains')
|
|
166
|
+
client_attributes = {
|
|
167
|
+
'mobile': '+81xxxxxxxxxx'
|
|
168
|
+
}
|
|
169
|
+
self.assertTrue(self.sut.evaluate_rule(client_attributes))
|
|
170
|
+
|
|
171
|
+
client_attributes = {
|
|
172
|
+
'mobile': '+91xxxxxxxxxx'
|
|
173
|
+
}
|
|
174
|
+
self.assertFalse(self.sut.evaluate_rule(client_attributes))
|
|
175
|
+
|
|
121
176
|
def evaluation_common(self, type, val1, val2):
|
|
122
177
|
self.set_up_email(val1, 'balance', type)
|
|
123
178
|
client_attributes = {
|
|
File without changes
|
{ibm_appconfiguration_python_sdk-0.3.6 → ibm_appconfiguration_python_sdk-0.3.8}/examples/__init__.py
RENAMED
|
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
|