aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2018-05-27 10:12:24 +1200
committerAldo Cortesi <aldo@corte.si>2018-05-27 10:12:24 +1200
commite59ba1341775eb6eb169a0884b09f18997dd5792 (patch)
tree875b5c72236f4df41859176466cac336662c0567 /test
parentd1e3968fa887f601339ac158e4c0f5fff4b18a49 (diff)
downloadmitmproxy-e59ba1341775eb6eb169a0884b09f18997dd5792.tar.gz
mitmproxy-e59ba1341775eb6eb169a0884b09f18997dd5792.tar.bz2
mitmproxy-e59ba1341775eb6eb169a0884b09f18997dd5792.zip
Use deferral mechanism for cfg file options
Fixes #3162
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_optmanager.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/mitmproxy/test_optmanager.py b/test/mitmproxy/test_optmanager.py
index 4356434b..2d408b6e 100644
--- a/test/mitmproxy/test_optmanager.py
+++ b/test/mitmproxy/test_optmanager.py
@@ -269,11 +269,13 @@ def test_serialize():
t = "# a comment"
optmanager.load(o2, t)
- assert optmanager.load(o2, "foobar: '123'") == {"foobar": "123"}
+ optmanager.load(o2, "foobar: '123'")
+ assert o2._deferred == {"foobar": "123"}
t = ""
optmanager.load(o2, t)
- assert optmanager.load(o2, "foobar: '123'") == {"foobar": "123"}
+ optmanager.load(o2, "foobar: '123'")
+ assert o2._deferred == {"foobar": "123"}
def test_serialize_defaults():
@@ -297,7 +299,8 @@ def test_saving(tmpdir):
with open(dst, 'a') as f:
f.write("foobar: '123'")
- assert optmanager.load_paths(o, dst) == {"foobar": "123"}
+ optmanager.load_paths(o, dst)
+ assert o._deferred == {"foobar": "123"}
with open(dst, 'a') as f:
f.write("'''")