aboutsummaryrefslogtreecommitdiffstats
path: root/test/mitmproxy/contentviews/test_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/mitmproxy/contentviews/test_base.py')
-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)