# ============LICENSE_START===============================================
# Copyright (C) 2021-2023 Nordix Foundation. All rights reserved.
+# Copyright (C) 2023-2024 OpenInfra Foundation Europe. 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.
assert response.status_code == 200
assert response.data == b"2"
-
-def test_notificationDestination(client):
- testdata=get_testdata_dir()
- # Header for json payload
- header = {
- "Content-Type" : "application/json"
- }
-
- # === API: Update policy instance pi2 of type: 2 ==="
- with open(testdata+'pi2.json') as json_file:
- policytype_2 = json.load(json_file)
- response = client.put(SERVER_URL+"a1-p/policytypes/2/policies/pi2?notificationDestination=http://localhost:8085/statustest", headers=header, data=json.dumps(policytype_2))
- assert response.status_code == 202
- result = response.data
- assert result == b""
-
def test_notificationDestination(client):
test_data = get_testdata_dir() + 'pi2.json'
# Header for json payload
# === API: Update policy instance pi2 of type: 2 ==="
with open(test_data) as json_file:
payload = json.load(json_file)
- response = client.put(SERVER_URL+"a1-p/policytypes/2/policies/pi2?notificationDestination=http://localhost:8085/statustest", headers=header, data=json.dumps(payload))
+ response = client.put(SERVER_URL+"a1-p/policytypes/2/policies/pi2?notificationDestination=http://localhost:8086/statustest", headers=header, data=json.dumps(payload))
assert response.status_code == 202
result = response.data
test_data = get_testdata_dir() + 'pi2.json'
header = { "Content-Type" : "application/json" }
+ # Timeout can be removed with polling the endpoints if required
+ proc.join(timeout=10)
+
# === Send status for pi2===
with open(test_data) as json_file:
payload = json.load(json_file)