Add fourth work package for REST API implementation
[anna.git] / example / diameter / launcher / resources / rest_api / ct / fsm-testing / test-ttps_test.py
1 import pytest
2
3
4 def test_001_i_want_to_set_a_valid_test_ttps(admlc):
5
6   requestBody = { "amount":5 }
7   responseBodyRef = { "success":"true", "response":"Assigned new test launch rate to 5 events per second" }
8
9   # Send POST
10   response = admlc.postDict("/test-ttps", requestBody)
11
12   # Verify response
13   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
14
15   # Leave stopped
16   response = admlc.postDict("/test-ttps", { "amount":0 })
17   responseBodyRef = { "success":"true", "response":"Assigned new test launch rate to 0 events per second" }
18   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
19
20 def test_002_i_want_to_set_an_invalid_test_ttps(admlc):
21
22   requestBody = { "amount":-8 }
23   responseBodyRef = { "success":"false", "response":"Internal error (check ADML traces): unable to configure the test rate provided" }
24
25   # Send POST
26   response = admlc.postDict("/test-ttps", requestBody)
27
28   # Verify response
29   admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
30
31   # Leave stopped
32   #response = admlc.postDict("/test-ttps", { "amount":0 })
33   #responseBodyRef = { "success":"true", "response":"Assigned new test launch rate to 0 events per second" }
34   #admlc.assert_response__status_body_headers(response, 200, responseBodyRef)