aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_console_contentview.py
diff options
context:
space:
mode:
authorroot <root@mint>2013-12-24 14:28:20 +1300
committerroot <root@mint>2013-12-24 14:28:20 +1300
commit932464d0a0f572e256f6dea898196db1e3f66b50 (patch)
tree2c9f43881e81e961e37b97e4daa46ba080e0edc9 /test/test_console_contentview.py
parent359573a764220a3bad94729ff5dce4e94ce2a187 (diff)
downloadmitmproxy-932464d0a0f572e256f6dea898196db1e3f66b50.tar.gz
mitmproxy-932464d0a0f572e256f6dea898196db1e3f66b50.tar.bz2
mitmproxy-932464d0a0f572e256f6dea898196db1e3f66b50.zip
test passing, UI still not working
Diffstat (limited to 'test/test_console_contentview.py')
-rw-r--r--test/test_console_contentview.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_console_contentview.py b/test/test_console_contentview.py
index ef44f834..c2ed2ffa 100644
--- a/test/test_console_contentview.py
+++ b/test/test_console_contentview.py
@@ -250,3 +250,17 @@ if cv.ViewProtobuf.is_available():
def test_get_by_shortcut():
assert cv.get_by_shortcut("h")
+
+def test_search_highlights():
+ # Default text in requests is content. We will search for nt once, and
+ # expect the first bit to be highlighted. We will do it again and expect the
+ # second to be.
+ f = tutils.tflowview()
+
+ ui_elements = f.search("nt")
+ text_object = ui_elements.contents()[2]
+ assert text_object.get_text() == ('content', [(None, 2), ('dark red', 2)])
+
+ ui_elements = f.search("nt")
+ text_object = ui_elements.contents()[2]
+ assert text_object.get_text() == ('content', [(None, 5), ('dark red', 2)])