import glob
from libmproxy import utils, script
from libmproxy.proxy import config
import tservers


def test_load_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 "iframe_injector" in f:
            f += " foo"  # one argument required
        if "modify_response_body" in f:
            f += " foo bar"  # two arguments required
        script.Script(f, tmaster)  # Loads the script file.
@@ -5,16 +5,28 @@
 rt glob%0A
+import mock%0A
 from lib
@@ -105,16 +105,69 @@
 ervers%0A%0A
+@mock.patch.dict(%22sys.modules%22, %7B%22bs4%22: mock.Mock()%7D)
 %0Adef tes
@@ -184,17 +184,16 @@
 ipts():%0A
-%0A
     exam

fix tests