# ============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.
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')
# 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
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