This commit is contained in:
Maximilian Hils 2017-02-01 17:52:01 +01:00 committed by GitHub
parent 4b10212caf
commit 7b2a986cea

View File

@ -231,7 +231,15 @@ class TestScriptLoader:
o = options.Options(scripts=["one", "one"]) o = options.Options(scripts=["one", "one"])
m = master.Master(o, proxy.DummyServer()) m = master.Master(o, proxy.DummyServer())
sc = script.ScriptLoader() sc = script.ScriptLoader()
tutils.raises(exceptions.OptionsError, m.addons.add, o, sc) with tutils.raises(exceptions.OptionsError):
m.addons.add(o, sc)
def test_nonexistent(self):
o = options.Options(scripts=["nonexistent"])
m = master.Master(o, proxy.DummyServer())
sc = script.ScriptLoader()
with tutils.raises(exceptions.OptionsError):
m.addons.add(o, sc)
def test_order(self): def test_order(self):
rec = tutils.test_data.path("mitmproxy/data/addonscripts/recorder.py") rec = tutils.test_data.path("mitmproxy/data/addonscripts/recorder.py")