X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=near-rt-ric-simulator%2Ftests%2Ftest_osc_2_1_0.py;fp=near-rt-ric-simulator%2Ftests%2Ftest_osc_2_1_0.py;h=deff757a98674c27c4a1f51faf6dabf8d9f5b029;hb=24ee2701e54884c8fc2ed7e6cf522d71286a3b33;hp=9d70ed0726f82231d1595b168c0b834e4348151f;hpb=59e2b2abfe0474acacb44a2922bfaf01b26bfa06;p=sim%2Fa1-interface.git diff --git a/near-rt-ric-simulator/tests/test_osc_2_1_0.py b/near-rt-ric-simulator/tests/test_osc_2_1_0.py index 9d70ed0..deff757 100644 --- a/near-rt-ric-simulator/tests/test_osc_2_1_0.py +++ b/near-rt-ric-simulator/tests/test_osc_2_1_0.py @@ -1,5 +1,5 @@ # ============LICENSE_START=============================================== -# Copyright (C) 2020 Nordix Foundation. All rights reserved. +# Copyright (C) 2021 Nordix Foundation. All rights reserved. # ======================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -156,11 +156,15 @@ def test_apis(client): res=compare(data_policies_get, result) assert res == True - # API: Create policy instance pi2 (copy of pi1) of type: 1. Shall fail + # API: Create policy instance pi2 (copy of pi1) of type: 1. with open(testdata+'pi1.json') as json_file: policy_2 = json.load(json_file) response=client.put(SERVER_URL+'a1-p/policytypes/1/policies/pi2', headers=header, data=json.dumps(policy_2)) - assert response.status_code == 400 + assert response.status_code == 202 + + # API: DELETE policy instance pi1 + response=client.delete(SERVER_URL+'a1-p/policytypes/1/policies/pi2') + assert response.status_code == 202 # Set force response code 401 response=client.post(SERVER_URL+'forceresponse?code=401') @@ -266,7 +270,7 @@ def test_apis(client): # API: Create policy instance pi2 of type: 2. Missing param, shall fail with open(testdata+'pi2_missing_param.json') as json_file: policy_2 = json.load(json_file) - response=client.put(SERVER_URL+'a1-p/policytypes/2/policies/pi1', headers=header, data=json.dumps(policy_2)) + response=client.put(SERVER_URL+'a1-p/policytypes/2/policies/pi2', headers=header, data=json.dumps(policy_2)) assert response.status_code == 400 # API: Create policy instance pi2 of type: 2 @@ -296,12 +300,6 @@ def test_apis(client): res=compare(data_policies_get, result) assert res == True - # API: Create policy instance pi11 (copy of pi1) of type: 1. Shall fail - with open(testdata+'pi1.json') as json_file: - policy_1 = json.load(json_file) - response=client.put(SERVER_URL+'a1-p/policytypes/1/policies/pi11', headers=header, data=json.dumps(policy_1)) - assert response.status_code == 400 - # Set force response code 409. ===" response=client.post(SERVER_URL+'forceresponse?code=401') assert response.status_code == 200