Passed
Push — master ( 9d0aac...94efac )
by Amresh
01:23
created

fuzzer.__main__.test_apis()   A

Complexity

Conditions 2

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 2
nop 0
1
import multiprocessing
2
from fuzzer.cli.args import cli_args
3
from fuzzer.rest_fuzzer import fuzz
4
from fuzzer.rest_fuzzer.json_schema import make_schema_object
5
6
7
server_host = cli_args.host
8
server_port = cli_args.port
9
api_list = cli_args.api_json
10
11
process_args = [(
12
    server_host,
13
    server_port,
14
    api_object,
15
    make_schema_object(api_object['body'])
16
) for api_object in api_list]
17
18
19
def test_apis():
20
    with multiprocessing.Pool(multiprocessing.cpu_count()) as proc:
21
        proc.map(fuzz.api_nx, process_args)
22
23
24
if __name__ == '__main__':
25
    test_apis()
26