X-Git-Url: https://git.teslayout.com/public/public/public//public/public/public//public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fresources%2Frest_api%2Fct%2Fhelpers%2Fsave-answermsg_test.py;fp=example%2Fdiameter%2Flauncher%2Fresources%2Frest_api%2Fct%2Fhelpers%2Fsave-answermsg_test.py;h=c0976a687a7b0037a8c571bc6f2b497914fdc4c0;hb=d444f6e9cab931a4364c15b86ab221e55893f975;hp=0000000000000000000000000000000000000000;hpb=e782294456d0877aa8fc05aa931291ac79808eb3;p=anna.git diff --git a/example/diameter/launcher/resources/rest_api/ct/helpers/save-answermsg_test.py b/example/diameter/launcher/resources/rest_api/ct/helpers/save-answermsg_test.py new file mode 100644 index 0000000..c0976a6 --- /dev/null +++ b/example/diameter/launcher/resources/rest_api/ct/helpers/save-answermsg_test.py @@ -0,0 +1,46 @@ +import pytest + + +@pytest.mark.helpers +def test_001_save_answermsg2e(saveB64Artifact, admlc): + + requestBody = { "name":"afHost.afRealm.com" } + responseBodyRef = { "success":"true", "response":"Forced node is now 'afHost.afRealm.com'" } + + # Send POST + response = admlc.postDict("/node", requestBody) + + # Verify response + admlc.assert_response__status_body_headers(response, 200, responseBodyRef) + + # Send POST + response = admlc.postDict("/answermsg2e", { "action":"" }) + + # Verify response + assert response["status"] == 200 + assert response["body"]["success"] == "true" + + # Save artifact from base64 encoded string received + saveB64Artifact(response["body"]["response"], "helpers/answermsg2e", False) # it is direct text content + +@pytest.mark.helpers +def test_002_save_answermsg2c(saveB64Artifact, admlc): + + requestBody = { "name":"ownHostId.operatorRealm.com" } + responseBodyRef = { "success":"true", "response":"Forced node is now 'ownHostId.operatorRealm.com'" } + + # Send POST + response = admlc.postDict("/node", requestBody) + + # Verify response + admlc.assert_response__status_body_headers(response, 200, responseBodyRef) + + # Send POST + response = admlc.postDict("/answermsg2c", { "action":"" }) + + # Verify response + assert response["status"] == 200 + assert response["body"]["success"] == "true" + + # Save artifact from base64 encoded string received + saveB64Artifact(response["body"]["response"], "helpers/answermsg2c", False) # it is direct text content