Implement dynamic procedure at REST interface
[anna.git] / example / diameter / launcher / resources / rest_api / ct / dynamic-procedure / dynamic_test.py
diff --git a/example/diameter/launcher/resources/rest_api/ct/dynamic-procedure/dynamic_test.py b/example/diameter/launcher/resources/rest_api/ct/dynamic-procedure/dynamic_test.py
new file mode 100644 (file)
index 0000000..6876e21
--- /dev/null
@@ -0,0 +1,30 @@
+import pytest
+
+
+@pytest.mark.dynamic
+@pytest.mark.xfail(reason="This will fail if already provisioned (if you want success here, restart the ADML HTTP Service)")
+def test_001_given_servicesGx_json_representation_i_want_to_load_it_through_adml_service(resources, admlc):
+
+  # Load services for Gx interface (client/server nodes & Gx dictionary):
+  requestBody = resources("servicesGxJson-request.json")
+  responseBodyRef = { "success":"true", "response":"loaded services correctly" }
+
+  # Send POST
+  response = admlc.post("/services", requestBody)
+
+  ### Verify response
+  admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
+
+@pytest.mark.dynamic
+def test_002_provision_dynamic_operation_for_gx_at_adml(resources, admlc):
+
+  # Dynamic procedure:
+  requestBody = resources("arguments-request.json")
+  responseBodyRef = { "success":"true", "response":"Completed provision: range [0000, 9000]; scenary: CCR-Initial + CCR-Termination" }
+
+  # Send POST
+  response = admlc.post("/dynamic", requestBody)
+
+  # Verify response
+  admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
+