summaryrefslogtreecommitdiffstats
path: root/test/test_api_validation.py
diff options
context:
space:
mode:
authordhebeha <dhebeha.mj71@wipro.com>2020-08-17 10:30:43 +0530
committerdhebeha <dhebeha.mj71@wipro.com>2020-08-17 10:30:43 +0530
commitb712a135c2d84f5b6361583e75a0cb25493b4585 (patch)
tree35c8082f0d5016d3e29744c840df86a9908092fa /test/test_api_validation.py
parent01cd5da39097c948e4fba94eb785b60452c70af3 (diff)
Add API layer for NSSI selection
Issue-ID: OPTFRA-801 Signed-off-by: dhebeha <dhebeha.mj71@wipro.com> Change-Id: Ib9740d24b8f160708811ddb70138a49ce592e93b
Diffstat (limited to 'test/test_api_validation.py')
-rw-r--r--test/test_api_validation.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_api_validation.py b/test/test_api_validation.py
index 50941e9..37f1321 100644
--- a/test/test_api_validation.py
+++ b/test/test_api_validation.py
@@ -23,6 +23,7 @@ from schematics.exceptions import DataError
from apps.placement.models.api.placementRequest import PlacementAPI
from apps.placement.models.api.placementResponse import PlacementResponse
from apps.slice_selection.models.api.nsi_selection_request import NSISelectionAPI
+from apps.slice_selection.models.api.nssi_selection_request import NSSISelectionAPI
class TestReqValidation(unittest.TestCase):
@@ -47,6 +48,16 @@ class TestReqValidation(unittest.TestCase):
req_json = json.loads(open(req_file).read())
self.assertRaises(DataError, lambda: NSISelectionAPI(req_json).validate())
+ def test_req_nssi_validation(self):
+ req_file = "./test/apps/slice_selection/nssi_selection_request.json"
+ req_json = json.loads(open(req_file).read())
+ self.assertEqual(NSSISelectionAPI(req_json).validate(), None)
+
+ def test_req_invalid_nssi(self):
+ req_file = "./test/apps/slice_selection/nssi_selection_invalid_request.json"
+ req_json = json.loads(open(req_file).read())
+ self.assertRaises(DataError, lambda: NSSISelectionAPI(req_json).validate())
+
def test_req_failure(self):
req_json = {}
self.assertRaises(DataError, lambda: PlacementAPI(req_json).validate())