Added helpers to pytest tests
[anna.git] / example / diameter / launcher / resources / rest_api / ct / helpers / save-loadmsg_test.py
1 import pytest
2
3
4 @pytest.mark.helpers
5 def test_001_save_msg_loaded(saveB64Artifact, b64_encode, resources, admlc):
6
7   requestBody = resources("aar-diameterJson-request.json")
8
9   # reponse field in response body, should carry the base64 encoding for xml message loaded by ADML:
10   xmlExpected = resources("aar.xml")
11   responseBodyRef = { "success":"true", "response":"{}".format(b64_encode(xmlExpected)) }
12
13   # Send POST
14   response = admlc.post("/loadmsg", requestBody)
15
16   ### Verify response
17   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
18
19   # Save artifact from base64 encoded string received
20   saveB64Artifact(response["body"]["response"], "helpers/loadmsg")