Add fourth work package for REST API implementation
[anna.git] / example / diameter / launcher / resources / rest_api / ct / fsm-testing / test-report_test.py
1 import pytest
2
3
4 def test_001_i_want_to_enable_test_reports_for_any_state(admlc):
5
6   response = admlc.postDict("/test-report", {})
7
8   # Verify response
9   responseBodyRef = { "success":"true", "response":"Report enabled for tests in 'any' state" }
10   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
11
12 def test_002_i_want_to_disable_test_reports_for_any_state(admlc):
13
14   response = admlc.postDict("/test-report", { "action":"disable" })
15
16   # Verify response
17   responseBodyRef = { "success":"true", "response":"Report disabled for tests in 'any' state" }
18   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
19
20
21 def test_003_i_want_to_enable_test_reports_for_failed_state(admlc):
22
23   response = admlc.postDict("/test-report", { "state":"failed" })
24
25   # Verify response
26   responseBodyRef = { "success":"true", "response":"Report enabled for tests in 'failed' state" }
27   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
28
29 def test_004_i_want_to_enable_test_reports_for_invalid_state(admlc):
30
31   response = admlc.postDict("/test-report", { "state":"INVALID STATE" })
32
33   # Verify response
34   responseBodyRef = { "success":"false", "response":"Internal error (check ADML traces): invalid state (allowed: initialized|in-progress|failed|success|[all]|none)" }
35   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
36