aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2020-04-14 08:49:19 -0700
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2020-04-15 15:26:29 +0000
commitae16faf7fdde8b05ab8dffc75378005dfe972360 (patch)
tree4d806a20626baf465ecedb914c0f2079db632f23 /test
parentc68b629f457fe00387075ed260b6d0a5c0bb45a0 (diff)
Extend unit tests for provisioning management service
This adds additional unit tests for the service provider for PATCH and DELETE request methods. Change-Id: If0cce9c713f2999c859910661308c24ac68f04d6 Issue-ID: INT-1529 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'test')
-rw-r--r--test/mocks/prov-mns-provider/src/test_mns.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/mocks/prov-mns-provider/src/test_mns.py b/test/mocks/prov-mns-provider/src/test_mns.py
index 1ae88e8ce..53a984738 100644
--- a/test/mocks/prov-mns-provider/src/test_mns.py
+++ b/test/mocks/prov-mns-provider/src/test_mns.py
@@ -10,6 +10,7 @@ logger = logging.getLogger(__name__)
MOI_ID = str(uuid4())
MOI_CLASS = ProvMnSProvider.Cretaed_MOIs_list[0]['class']
MOI_DATA_TMPL = { 'data': ProvMnSProvider.Cretaed_MOIs_list[0] }
+MOI_DATA_PATCH = { "data": { "pLMNId": "xxx", "gNBId": "1234", "gNBIdLength": "4" }}
URI_SCHEMA = 'http'
AUTH_STRING = (ProvMnSProvider.username, ProvMnSProvider.password)
URI_BASE_STRING = URI_SCHEMA + '://' + ProvMnSProvider.ipAddress + ':' + \
@@ -47,3 +48,27 @@ def test_get():
logger.debug('Response content: {0}'.format(req_get.text))
assert req_get.status_code == requests.codes.ok
+
+def test_patch():
+ '''Validate PATCH request'''
+
+ req_patch = requests.patch('{0}'.format(URI_PATCH_STRING),
+ auth=AUTH_STRING, json=MOI_DATA_PATCH)
+
+ if req_patch.status_code != requests.codes.ok:
+ logger.error('PATCH request to {0} failed'.format(URI_PATCH_STRING))
+ logger.debug('Response content: {0}'.format(req_patch.text))
+
+ assert req_patch.status_code == requests.codes.ok
+
+def test_delete():
+ '''Validate DELETE request'''
+
+ req_delete = requests.delete('{0}'.format(URI_DELETE_STRING),
+ auth=AUTH_STRING)
+
+ if req_delete.status_code != requests.codes.ok:
+ logger.error('DELETE request to {0} failed'.format(URI_DELETE_STRING))
+ logger.debug('Response content: {0}'.format(req_delete.text))
+
+ assert req_delete.status_code == requests.codes.ok