aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2017-06-13 12:33:36 +1200
committerGitHub <noreply@github.com>2017-06-13 12:33:36 +1200
commit08972c3f5bb76b6ff60ea3124c85e3e3cd6f30f0 (patch)
tree39c739c7e19a0ff1afb3066049a525005ac28b88 /test
parent9da6cc4534af50e456c4bf93b5e4a2fc862d377c (diff)
parentba49b556843a7564b5a2a9bd49b206e42d8327c9 (diff)
downloadmitmproxy-08972c3f5bb76b6ff60ea3124c85e3e3cd6f30f0.tar.gz
mitmproxy-08972c3f5bb76b6ff60ea3124c85e3e3cd6f30f0.tar.bz2
mitmproxy-08972c3f5bb76b6ff60ea3124c85e3e3cd6f30f0.zip
Merge pull request #2394 from cortesi/moarconsole
Misc console-related improvements
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_view.py10
-rw-r--r--test/mitmproxy/test_command.py2
-rw-r--r--test/mitmproxy/test_optmanager.py4
3 files changed, 15 insertions, 1 deletions
diff --git a/test/mitmproxy/addons/test_view.py b/test/mitmproxy/addons/test_view.py
index d5a3a456..40136f1f 100644
--- a/test/mitmproxy/addons/test_view.py
+++ b/test/mitmproxy/addons/test_view.py
@@ -262,6 +262,16 @@ def test_duplicate():
assert v.focus.index == 2
+def test_remove():
+ v = view.View()
+ with taddons.context():
+ f = [tflow.tflow(), tflow.tflow()]
+ v.add(f)
+ assert len(v) == 2
+ v.remove(f)
+ assert len(v) == 0
+
+
def test_setgetval():
v = view.View()
with taddons.context():
diff --git a/test/mitmproxy/test_command.py b/test/mitmproxy/test_command.py
index 958328b2..87432163 100644
--- a/test/mitmproxy/test_command.py
+++ b/test/mitmproxy/test_command.py
@@ -22,7 +22,7 @@ class TAddon:
def empty(self) -> None:
pass
- def varargs(self, one: str, *var: typing.Sequence[str]) -> typing.Sequence[str]:
+ def varargs(self, one: str, *var: str) -> typing.Sequence[str]:
return list(var)
diff --git a/test/mitmproxy/test_optmanager.py b/test/mitmproxy/test_optmanager.py
index 04ec7ded..cadc5d76 100644
--- a/test/mitmproxy/test_optmanager.py
+++ b/test/mitmproxy/test_optmanager.py
@@ -257,6 +257,10 @@ def test_serialize():
with pytest.raises(Exception, match="Config error"):
optmanager.load(o2, t)
+ t = "# a comment"
+ optmanager.load(o2, t)
+ assert optmanager.load(o2, "foobar: '123'") == {"foobar": "123"}
+
t = ""
optmanager.load(o2, t)
assert optmanager.load(o2, "foobar: '123'") == {"foobar": "123"}