Add fourth work package for REST API implementation
[anna.git] / example / diameter / launcher / resources / rest_api / ct / fsm-testing / test-junit_test.py
diff --git a/example/diameter/launcher/resources/rest_api/ct/fsm-testing/test-junit_test.py b/example/diameter/launcher/resources/rest_api/ct/fsm-testing/test-junit_test.py
new file mode 100644 (file)
index 0000000..05d058d
--- /dev/null
@@ -0,0 +1,36 @@
+import pytest
+
+
+def test_001_i_want_to_dump_the_junit_report_of_adml(admlc):
+
+  requestBody = { "targetFile":"/opt/adml/junit.xml" }
+  responseBodyRef = { "success":"true", "response":"Junit report written on '/opt/adml/junit.xml'" }
+
+  # Send POST
+  response = admlc.postDict("/test-junit", requestBody)
+
+  # Verify response
+  admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
+
+def test_002_i_want_to_dump_the_junit_report_of_adml_at_invalid_location(admlc):
+
+  requestBody = { "targetFile":"/invalid/path/junit.xml" }
+  responseBodyRef = { "success":"false", "response":"Internal error (check ADML traces): error opening '/invalid/path/junit.xml'" }
+
+  # Send POST
+  response = admlc.postDict("/test-junit", requestBody)
+
+  # Verify response
+  admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
+
+def test_003_i_want_to_dump_the_junit_report_of_adml_at_default_location(admlc):
+
+  responseBodyRef = { "success":"true", "response":"Junit report written on '/tmp/junit.xml'" }
+
+  # Send POST
+  response = admlc.postDict("/test-junit", {})
+
+  # Verify response
+  admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
+
+