X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fresources%2Frest_api%2Fct%2Fhelpers%2Fsave-decode_test.py;fp=example%2Fdiameter%2Flauncher%2Fresources%2Frest_api%2Fct%2Fhelpers%2Fsave-decode_test.py;h=c4d7eabf64340bb8d0523648befc1cf91f5af67d;hp=0000000000000000000000000000000000000000;hb=d444f6e9cab931a4364c15b86ab221e55893f975;hpb=e782294456d0877aa8fc05aa931291ac79808eb3 diff --git a/example/diameter/launcher/resources/rest_api/ct/helpers/save-decode_test.py b/example/diameter/launcher/resources/rest_api/ct/helpers/save-decode_test.py new file mode 100644 index 0000000..c4d7eab --- /dev/null +++ b/example/diameter/launcher/resources/rest_api/ct/helpers/save-decode_test.py @@ -0,0 +1,22 @@ +import pytest + + +@pytest.mark.helpers +def test_001_save_decoded(saveB64Artifact, b64_encode, resources, admlc): + + diameterHex = resources("aaa.hex") + #requestBody = resources("aaa-diameterHex.json.in", diameterHex=diameterHex.rstrip()) + requestBodyDict = { "diameterHex":"{}".format(diameterHex.rstrip()) } + + # reponse field in response body, should carry the base64 encoding for xml message decoded by ADML: + xmlExpected = resources("aaa.xml") + responseBodyRef = { "success":"true", "response":"{}".format(b64_encode(xmlExpected)) } + + # Send POST + response = admlc.postDict("/decode", requestBodyDict) + + # Verify response + admlc.assert_response__status_body_headers(response, 200, responseBodyRef) + + # Save artifact from base64 encoded string received + saveB64Artifact(response["body"]["response"], "helpers/decode")