mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
fix tests
This commit is contained in:
parent
41f49ff0d4
commit
a73ad1d945
@ -7,8 +7,7 @@ from libmproxy.protocol.http import decoded
|
||||
|
||||
def start(ctx, argv):
|
||||
if len(argv) != 3:
|
||||
ctx.log('Usage: -s "modify-response-body.py old new"')
|
||||
sys.exit(1)
|
||||
sys.exit('Usage: -s "modify-response-body.py old new"')
|
||||
global old, new # In larger scripts, a centralized options object (as returned by argparse) is encouraged
|
||||
old, new = argv[1:]
|
||||
|
||||
|
@ -1,12 +1,17 @@
|
||||
from libmproxy import utils, script
|
||||
import glob
|
||||
from libmproxy import utils, script
|
||||
from libmproxy.proxy import config
|
||||
import tservers
|
||||
|
||||
example_dir = utils.Data("libmproxy").path("../examples")
|
||||
scripts = glob.glob("%s/*.py" % example_dir)
|
||||
|
||||
tmaster = tservers.TestMaster(config.ProxyConfig())
|
||||
def test_load_scripts():
|
||||
|
||||
for f in scripts:
|
||||
example_dir = utils.Data("libmproxy").path("../examples")
|
||||
scripts = glob.glob("%s/*.py" % example_dir)
|
||||
|
||||
tmaster = tservers.TestMaster(config.ProxyConfig())
|
||||
|
||||
for f in scripts:
|
||||
if "modify_response_body" in f:
|
||||
f += " foo bar" # two arguments required
|
||||
script.Script(f, tmaster) # Loads the script file.
|
Loading…
Reference in New Issue
Block a user