Implement dynamic procedure at REST interface
[anna.git] / example / diameter / launcher / resources / rest_api / ct / hot-changes / services_test.py
1 import pytest
2
3 @pytest.mark.skip(reason="this is run as part of 'ct.sh' wrapper script")
4 @pytest.mark.run(order=1)
5 @pytest.mark.xfail(reason="This will fail if already provisioned (if you want success here, restart the ADML HTTP Service)")
6 def test_001_given_services_json_representation_i_want_to_load_it_through_adml_service(resources, admlc):
7
8   # Load services for Rx interface (client/server nodes & Gx dictionary):
9   requestBody = resources("servicesRxJson-request.json")
10   responseBodyRef = { "success":"true", "response":"loaded services correctly" }
11
12   # Send POST
13   response = admlc.post("/services", requestBody)
14
15   ### Verify response
16   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
17
18 def test_002_given_dummy_services_json_representation_i_want_to_load_it_through_adml_service(resources, admlc):
19
20   requestBody = resources("servicesDummyJson-request.json")
21   responseBodyRef = { "success":"true", "response":"loaded services correctly" }
22
23   # Send POST
24   response = admlc.post("/services", requestBody)
25
26   ### Verify response
27   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
28