/
runif.py
47 lines (41 loc) · 1.44 KB
/
runif.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8 -*-
'''
Created on 2014-8-26
@author: Kemin Yu
'''
import sys
import optparse
from scenario import Scenario
from params import Param
from webparams import WebParam
def commandui(args=sys.argv[1:]):
parser = optparse.OptionParser(usage="%prog [options]", version="%prog 1.0")
parser.add_option("-s", "--scenario",
dest="scenario",
action="store_true",
default=False,
help='run scenario request - login first, then run multi-requests')
parser.add_option("-a", "--app",
dest="app",
action="store_true",
default=False,
help='run application if. parameter checking request - login first, then run multi-requests')
parser.add_option("-w", "--web",
dest="web",
action="store_true",
default=False,
help='run web if. parameter checking request - login first, then run multi-requests')
(options, args) = parser.parse_args(args)
if options.scenario: # update tools
s = Scenario()
s.run()
elif options.app:
p = Param()
p.run()
p.print_result()
elif options.web:
p = WebParam()
p.run()
p.print_result()
if __name__ == '__main__':
commandui()