aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
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"}