Implement dynamic procedure at REST interface
[anna.git] / example / diameter / launcher / resources / rest_api / ct / dynamic-procedure / dynamic_test.py
1 import pytest
2
3
4 @pytest.mark.dynamic
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_servicesGx_json_representation_i_want_to_load_it_through_adml_service(resources, admlc):
7
8   # Load services for Gx interface (client/server nodes & Gx dictionary):
9   requestBody = resources("servicesGxJson-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 @pytest.mark.dynamic
19 def test_002_provision_dynamic_operation_for_gx_at_adml(resources, admlc):
20
21   # Dynamic procedure:
22   requestBody = resources("arguments-request.json")
23   responseBodyRef = { "success":"true", "response":"Completed provision: range [0000, 9000]; scenary: CCR-Initial + CCR-Termination" }
24
25   # Send POST
26   response = admlc.post("/dynamic", requestBody)
27
28   # Verify response
29   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
30