Add fourth work package for REST API implementation
[anna.git] / example / diameter / launcher / resources / rest_api / ct / fsm-testing / test-junit_test.py
1 import pytest
2
3
4 def test_001_i_want_to_dump_the_junit_report_of_adml(admlc):
5
6   requestBody = { "targetFile":"/opt/adml/junit.xml" }
7   responseBodyRef = { "success":"true", "response":"Junit report written on '/opt/adml/junit.xml'" }
8
9   # Send POST
10   response = admlc.postDict("/test-junit", requestBody)
11
12   # Verify response
13   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
14
15 def test_002_i_want_to_dump_the_junit_report_of_adml_at_invalid_location(admlc):
16
17   requestBody = { "targetFile":"/invalid/path/junit.xml" }
18   responseBodyRef = { "success":"false", "response":"Internal error (check ADML traces): error opening '/invalid/path/junit.xml'" }
19
20   # Send POST
21   response = admlc.postDict("/test-junit", requestBody)
22
23   # Verify response
24   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
25
26 def test_003_i_want_to_dump_the_junit_report_of_adml_at_default_location(admlc):
27
28   responseBodyRef = { "success":"true", "response":"Junit report written on '/tmp/junit.xml'" }
29
30   # Send POST
31   response = admlc.postDict("/test-junit", {})
32
33   # Verify response
34   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
35
36