4 def test_001_i_want_to_make_one_test_non_interactive(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-interact", { "amount":-1, "id":flow })
18 responseBodyRef = { "success":"true", "response":"Interactive mode disabled for test case id {}".format(flow) }
19 admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
21 # Cleanup & restore ip-limit (at global level because it is easier)
22 response = admlc.post("/test-clear")
23 response = admlc.postDict("/test-ip-limit", { "amount":-1 })
25 def test_002_i_want_to_freeze_a_test(admlc, admlf):
27 # Send POST (test flow with a single step changing ip-limit to 15)
29 response = admlc.postDict("/testid-ip-limit/{}".format(flow), { "amount":15 })
31 # Verify response (test & step programmed)
32 responseBodyRef = { "success":"true", "response":"Done" }
33 admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
35 # Send POST (execute the former test)
36 response = admlc.postDict("/test-interact", { "amount":0, "id":flow })
39 respMsg = "Added interactive amount of 0 units (0: freezing a non-interactive testcase, no effect on already interactive) for test case id {}".format(flow)
40 responseBodyRef = { "success":"true", "response":respMsg }
41 admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
43 # Cleanup & restore ip-limit (at global level because it is easier)
44 response = admlc.post("/test-clear")
45 response = admlc.postDict("/test-ip-limit", { "amount":-1 })