4 def test_001_i_want_to_run_specific_test(admlc, admlf):
6 # Send POST (test flow with a single step changing ip-limit to 15)
8 response = admlc.postDict("/testid-ip-limit/{}".format(flow), { "amount":15 })
10 # Verify response (test & step programmed)
11 responseBodyRef = { "success":"true", "response":"Done" }
12 admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
14 # Send POST (execute the former test)
15 response = admlc.postDict("/test-run", { "id":flow })
18 responseBodyRef = { "success":"true", "response":"Test executed for id provided ({})".format(flow) }
19 admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
21 # Verify ip-limit now:
22 response = admlc.postDict("/test-ip-limit", {}) # default {} to query current state
23 responseBodyRef = { "success":"true", "response":"In-progress limit amount: 15; currently there are 0 test cases running" }
24 admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
26 # Cleanup & restore ip-limit (at global level because it is easier)
27 response = admlc.post("/test-clear")
28 response = admlc.postDict("/test-ip-limit", { "amount":-1 })
31 def test_002_i_want_to_run_unexisting_test(admlc):
34 response = admlc.postDict("/test-run", { "id":666 })
37 responseBodyRef = { "success":"false", "response":"Internal error (check ADML traces): cannot found test id (666)" }
38 admlc.assert_response__status_body_headers(response, 200, responseBodyRef)