diff options
author | krishna moorthy <krishna.moorthy6@wipro.com> | 2020-08-27 04:58:10 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-08-27 04:58:10 +0000 |
commit | 8d566ba1186b78b4ba134a9b5b8cdc106c2a06ee (patch) | |
tree | b1307edfbd43a8abb1759de12492d2ab2bdf8c92 /test/test_api_validation.py | |
parent | 2d770e68218a19ec3b0da34d3242355dd69e1a70 (diff) | |
parent | 01cd5da39097c948e4fba94eb785b60452c70af3 (diff) |
Merge "Change API layer for NSI selection"
Diffstat (limited to 'test/test_api_validation.py')
-rw-r--r-- | test/test_api_validation.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_api_validation.py b/test/test_api_validation.py index 73d03cd..50941e9 100644 --- a/test/test_api_validation.py +++ b/test/test_api_validation.py @@ -22,6 +22,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 class TestReqValidation(unittest.TestCase): @@ -36,6 +37,16 @@ class TestReqValidation(unittest.TestCase): req_json = json.loads(open(req_file).read()) self.assertEqual(PlacementAPI(req_json).validate(), None) + def test_req_nsi_validation(self): + req_file = "./test/apps/slice_selection/nsi_selection_request.json" + req_json = json.loads(open(req_file).read()) + self.assertEqual(NSISelectionAPI(req_json).validate(), None) + + def test_req_invalid_nsi(self): + req_file = "./test/apps/slice_selection/nsi_selection_invalid_request.json" + req_json = json.loads(open(req_file).read()) + self.assertRaises(DataError, lambda: NSISelectionAPI(req_json).validate()) + def test_req_failure(self): req_json = {} self.assertRaises(DataError, lambda: PlacementAPI(req_json).validate()) |