aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks/prov-mns-provider/src
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2020-04-15 04:48:16 -0700
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2020-04-15 15:26:29 +0000
commit6049499c5a17cfa58f351b3731837463b7359047 (patch)
tree64de7b158579283ce5983cddbbfaaaa7e9152bb5 /test/mocks/prov-mns-provider/src
parent1fe9c2906948704071ee5af2f743d6387b2dbe8f (diff)
Move tests to their own directory
File layout was also restructured for better readability. Change-Id: Id1cba755127319c45ec50b08d12daa543c8c9ae5 Issue-ID: INT-1529 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'test/mocks/prov-mns-provider/src')
l---------test/mocks/prov-mns-provider/src/tests/ConfigInfo.json1
l---------test/mocks/prov-mns-provider/src/tests/DefinedNRMFunction.json1
l---------test/mocks/prov-mns-provider/src/tests/ProvMnSProvider.py1
l---------test/mocks/prov-mns-provider/src/tests/UserInfo.json1
-rw-r--r--test/mocks/prov-mns-provider/src/tests/common.py23
l---------test/mocks/prov-mns-provider/src/tests/preSetMOI.json1
-rw-r--r--test/mocks/prov-mns-provider/src/tests/test-requirements.txt (renamed from test/mocks/prov-mns-provider/src/test-requirements.txt)0
-rw-r--r--test/mocks/prov-mns-provider/src/tests/test_rest_api_endpoints.py (renamed from test/mocks/prov-mns-provider/src/test_mns.py)24
-rw-r--r--test/mocks/prov-mns-provider/src/tox.ini2
9 files changed, 30 insertions, 24 deletions
diff --git a/test/mocks/prov-mns-provider/src/tests/ConfigInfo.json b/test/mocks/prov-mns-provider/src/tests/ConfigInfo.json
new file mode 120000
index 000000000..66ede7d7a
--- /dev/null
+++ b/test/mocks/prov-mns-provider/src/tests/ConfigInfo.json
@@ -0,0 +1 @@
+../ConfigInfo.json \ No newline at end of file
diff --git a/test/mocks/prov-mns-provider/src/tests/DefinedNRMFunction.json b/test/mocks/prov-mns-provider/src/tests/DefinedNRMFunction.json
new file mode 120000
index 000000000..a56d54d9d
--- /dev/null
+++ b/test/mocks/prov-mns-provider/src/tests/DefinedNRMFunction.json
@@ -0,0 +1 @@
+../DefinedNRMFunction.json \ No newline at end of file
diff --git a/test/mocks/prov-mns-provider/src/tests/ProvMnSProvider.py b/test/mocks/prov-mns-provider/src/tests/ProvMnSProvider.py
new file mode 120000
index 000000000..96f10491e
--- /dev/null
+++ b/test/mocks/prov-mns-provider/src/tests/ProvMnSProvider.py
@@ -0,0 +1 @@
+../ProvMnSProvider.py \ No newline at end of file
diff --git a/test/mocks/prov-mns-provider/src/tests/UserInfo.json b/test/mocks/prov-mns-provider/src/tests/UserInfo.json
new file mode 120000
index 000000000..cc7354bc5
--- /dev/null
+++ b/test/mocks/prov-mns-provider/src/tests/UserInfo.json
@@ -0,0 +1 @@
+../UserInfo.json \ No newline at end of file
diff --git a/test/mocks/prov-mns-provider/src/tests/common.py b/test/mocks/prov-mns-provider/src/tests/common.py
new file mode 100644
index 000000000..08075e999
--- /dev/null
+++ b/test/mocks/prov-mns-provider/src/tests/common.py
@@ -0,0 +1,23 @@
+import requests # pylint: disable=W0611
+from uuid import uuid4
+import ProvMnSProvider
+import logging
+from json import dumps # pylint: disable=W0611
+
+logging.basicConfig(level=logging.DEBUG)
+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 + ':' + \
+ str(ProvMnSProvider.portNumber) + ProvMnSProvider.prefix + \
+ '/' + MOI_CLASS + '/' + MOI_ID
+URI_PUT_STRING = URI_BASE_STRING
+URI_GET_STRING = URI_BASE_STRING + '?scope=BASE_ONLY&filter=' + MOI_CLASS + \
+ '&fields=gNBId&fields=gNBIdLength'
+URI_PATCH_STRING = URI_BASE_STRING + '?scope=BASE_ONLY&filter=' + MOI_CLASS
+URI_DELETE_STRING = URI_PATCH_STRING
diff --git a/test/mocks/prov-mns-provider/src/tests/preSetMOI.json b/test/mocks/prov-mns-provider/src/tests/preSetMOI.json
new file mode 120000
index 000000000..053256d80
--- /dev/null
+++ b/test/mocks/prov-mns-provider/src/tests/preSetMOI.json
@@ -0,0 +1 @@
+../preSetMOI.json \ No newline at end of file
diff --git a/test/mocks/prov-mns-provider/src/test-requirements.txt b/test/mocks/prov-mns-provider/src/tests/test-requirements.txt
index 547de5c5b..547de5c5b 100644
--- a/test/mocks/prov-mns-provider/src/test-requirements.txt
+++ b/test/mocks/prov-mns-provider/src/tests/test-requirements.txt
diff --git a/test/mocks/prov-mns-provider/src/test_mns.py b/test/mocks/prov-mns-provider/src/tests/test_rest_api_endpoints.py
index 53a984738..0cc459195 100644
--- a/test/mocks/prov-mns-provider/src/test_mns.py
+++ b/test/mocks/prov-mns-provider/src/tests/test_rest_api_endpoints.py
@@ -1,26 +1,4 @@
-import requests
-from uuid import uuid4
-import ProvMnSProvider
-import logging
-from json import dumps
-
-logging.basicConfig(level=logging.DEBUG)
-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 + ':' + \
- str(ProvMnSProvider.portNumber) + ProvMnSProvider.prefix + \
- '/' + MOI_CLASS + '/' + MOI_ID
-URI_PUT_STRING = URI_BASE_STRING
-URI_GET_STRING = URI_BASE_STRING + '?scope=BASE_ONLY&filter=' + MOI_CLASS + \
- '&fields=gNBId&fields=gNBIdLength'
-URI_PATCH_STRING = URI_BASE_STRING + '?scope=BASE_ONLY&filter=' + MOI_CLASS
-URI_DELETE_STRING = URI_PATCH_STRING
+from common import *
def test_put():
'''Validate PUT request'''
diff --git a/test/mocks/prov-mns-provider/src/tox.ini b/test/mocks/prov-mns-provider/src/tox.ini
index 02bc0435b..2f2976307 100644
--- a/test/mocks/prov-mns-provider/src/tox.ini
+++ b/test/mocks/prov-mns-provider/src/tox.ini
@@ -3,7 +3,7 @@ envlist = py3
skipsdist = True
[testenv]
-deps = -r{toxinidir}/test-requirements.txt
+deps = -r{toxinidir}/tests/test-requirements.txt
commands = pytest
[pytest]