X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fresources%2Frest_api%2Fct%2Ffsm-testing%2Ftest-look_test.py;fp=example%2Fdiameter%2Flauncher%2Fresources%2Frest_api%2Fct%2Ffsm-testing%2Ftest-look_test.py;h=0d2fb9a4b3846908df2181bdb5afde6758bc16bc;hb=080dc0740d8b02011dee032f5d44eeb5f2ffe23f;hp=0000000000000000000000000000000000000000;hpb=c200ffa70e1d93f5cb3137f3542245c44c05b008;p=anna.git diff --git a/example/diameter/launcher/resources/rest_api/ct/fsm-testing/test-look_test.py b/example/diameter/launcher/resources/rest_api/ct/fsm-testing/test-look_test.py new file mode 100644 index 0000000..0d2fb9a --- /dev/null +++ b/example/diameter/launcher/resources/rest_api/ct/fsm-testing/test-look_test.py @@ -0,0 +1,33 @@ +import pytest + + +def test_001_i_want_to_look_an_specific_test(b64_encode, resources, admlc, admlf): + + # Send POST + flow = admlf.getId() + response = admlc.postDict("/testid-description/{}".format(flow), { "description":"Look test" }) + + # Verify response + responseBodyRef = { "success":"true", "response":"Done" } + admlc.assert_response__status_body_headers(response, 200, responseBodyRef) + + # Send POST + response = admlc.postDict("/test-look", { "id":flow }) + + # Verify response + lookExpected = resources("look_output.txt").format(flow) + responseBodyRef = { "success":"true", "response":"{}".format(b64_encode(lookExpected)) } + admlc.assert_response__status_body_headers(response, 200, responseBodyRef) + + # Cleanup + response = admlc.post("/test-clear") + +def test_002_i_want_to_look_an_unexisting_test(admlc): + + # Send POST + response = admlc.postDict("/test-look", { "id":666 }) + + # Verify response + responseBodyRef = { "success":"false", "response":"Internal error (check ADML traces): cannot found test id (666)" } + admlc.assert_response__status_body_headers(response, 200, responseBodyRef) +