mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 02:10:59 +00:00
fix tests
This commit is contained in:
parent
a699bdc286
commit
667fe0c20b
1
setup.py
1
setup.py
@ -84,6 +84,7 @@ setup(
|
|||||||
'examples': [
|
'examples': [
|
||||||
"pytz",
|
"pytz",
|
||||||
"harparser",
|
"harparser",
|
||||||
|
"beautifulsoup4"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import glob
|
import glob
|
||||||
import mock
|
|
||||||
from libmproxy import utils, script
|
from libmproxy import utils, script
|
||||||
from libmproxy.proxy import config
|
from libmproxy.proxy import config
|
||||||
import tservers
|
import tservers
|
||||||
|
|
||||||
@mock.patch.dict("sys.modules", {"bs4": mock.Mock()})
|
|
||||||
def test_load_scripts():
|
def test_load_scripts():
|
||||||
example_dir = utils.Data("libmproxy").path("../examples")
|
example_dir = utils.Data("libmproxy").path("../examples")
|
||||||
scripts = glob.glob("%s/*.py" % example_dir)
|
scripts = glob.glob("%s/*.py" % example_dir)
|
||||||
@ -12,6 +10,8 @@ def test_load_scripts():
|
|||||||
tmaster = tservers.TestMaster(config.ProxyConfig())
|
tmaster = tservers.TestMaster(config.ProxyConfig())
|
||||||
|
|
||||||
for f in scripts:
|
for f in scripts:
|
||||||
|
if "har_extractor" in f:
|
||||||
|
f += " foo"
|
||||||
if "iframe_injector" in f:
|
if "iframe_injector" in f:
|
||||||
f += " foo" # one argument required
|
f += " foo" # one argument required
|
||||||
if "modify_response_body" in f:
|
if "modify_response_body" in f:
|
||||||
|
Loading…
Reference in New Issue
Block a user