X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;ds=sidebyside;f=example%2Fdiameter%2Flauncher%2Fresources%2Frest_api%2Fct%2Fnode-management%2Fnode_test.py;fp=example%2Fdiameter%2Flauncher%2Fresources%2Frest_api%2Fct%2Fnode-management%2Fnode_test.py;h=b5321c03c6a93e540a87256d1f330c0f2643df0b;hb=c881c12ed7e116f1d43760a0d9873f860c10a357;hp=0000000000000000000000000000000000000000;hpb=af14877201a9856708ec43086a229777d9cb3da7;p=anna.git diff --git a/example/diameter/launcher/resources/rest_api/ct/node-management/node_test.py b/example/diameter/launcher/resources/rest_api/ct/node-management/node_test.py new file mode 100644 index 0000000..b5321c0 --- /dev/null +++ b/example/diameter/launcher/resources/rest_api/ct/node-management/node_test.py @@ -0,0 +1,35 @@ +import pytest + + +def test_001_given_node_name_i_want_to_force_it_to_be_set_as_operated_node_at_adml(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) + +def test_002_i_want_to_know_current_operated_node_at_adml(admlc): + + requestBody = { "name":"" } + + # Send POST + response = admlc.postDict("/node", requestBody) + + # Verify response is ok (omit response content because it is informative and have dynamic data (timing)): + assert response["status"] == 200 + assert response["body"]["success"] == "true" + +def test_001_given_an_invalid_node_name_i_want_to_confirm_the_error_when_trying_to_enable_it_at_adml(admlc): + + requestBody = { "name":"this_does_not_exists" } + responseBodyRef = { "success":"true", "response":"Node 'this_does_not_exists' invalid. Nothing done" } + + # Send POST + response = admlc.postDict("/node", requestBody) + + # Verify response + admlc.assert_response__status_body_headers(response, 200, responseBodyRef)