aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_examples.py
blob: d18b586255d326748179476f64dc04c283b30461 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 "modify_response_body" in f:
            f += " foo bar"  # two arguments required
        script.Script(f, tmaster)  # Loads the script file.