aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorArushit Mudgal <rshtmudgal@gmail.com>2018-01-25 20:36:19 +0530
committerMaximilian Hils <git@maximilianhils.com>2018-01-25 16:06:19 +0100
commitf41d521ce51084f37c094a7a5368b77a7d0cd225 (patch)
tree9947db80c55bd891bffaceef670d37811780b411 /test
parent6dd336fcec6dc32c4986b6c20189bf1b2132153c (diff)
downloadmitmproxy-f41d521ce51084f37c094a7a5368b77a7d0cd225.tar.gz
mitmproxy-f41d521ce51084f37c094a7a5368b77a7d0cd225.tar.bz2
mitmproxy-f41d521ce51084f37c094a7a5368b77a7d0cd225.zip
fix #2800
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/contentviews/test_base.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/mitmproxy/contentviews/test_base.py b/test/mitmproxy/contentviews/test_base.py
index 777ab4dd..c94d8be2 100644
--- a/test/mitmproxy/contentviews/test_base.py
+++ b/test/mitmproxy/contentviews/test_base.py
@@ -1 +1,17 @@
-# TODO: write tests
+import pytest
+from mitmproxy.contentviews import base
+
+
+def test_format_dict():
+ d = {"one": "two", "three": "four"}
+ f_d = base.format_dict(d)
+ assert next(f_d)
+
+ d = {"adsfa": ""}
+ f_d = base.format_dict(d)
+ assert next(f_d)
+
+ d = {}
+ f_d = base.format_dict(d)
+ with pytest.raises(StopIteration):
+ next(f_d)