aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-10-29 11:50:10 +1300
committerAldo Cortesi <aldo@nullcube.com>2016-10-29 11:50:10 +1300
commit7ecaeb02145b1c9c514e65a81d3d1ae231dc681b (patch)
treeeababcc3e36cac724a55d123e1f09456875d17ab /test
parent32a0a7b8600c949a70ddabd332caca415ef82d42 (diff)
downloadmitmproxy-7ecaeb02145b1c9c514e65a81d3d1ae231dc681b.tar.gz
mitmproxy-7ecaeb02145b1c9c514e65a81d3d1ae231dc681b.tar.bz2
mitmproxy-7ecaeb02145b1c9c514e65a81d3d1ae231dc681b.zip
addons.view.focus: next and prev methods
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_view.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/mitmproxy/addons/test_view.py b/test/mitmproxy/addons/test_view.py
index 1404a78a..e4083bac 100644
--- a/test/mitmproxy/addons/test_view.py
+++ b/test/mitmproxy/addons/test_view.py
@@ -235,6 +235,31 @@ def test_focus():
assert f.index is None
+def test_focus_nextprev():
+ v = view.View()
+ # Nops on an empty view
+ v.focus.next()
+ v.focus.prev()
+
+ # Nops on a single-flow view
+ v.add(tft(start=0))
+ assert v.focus.focusflow == v[0]
+ v.focus.next()
+ assert v.focus.focusflow == v[0]
+ v.focus.prev()
+ assert v.focus.focusflow == v[0]
+
+ v.add(tft(start=1))
+ v.focus.next()
+ assert v.focus.focusflow == v[1]
+ v.focus.next()
+ assert v.focus.focusflow == v[1]
+ v.focus.prev()
+ assert v.focus.focusflow == v[0]
+ v.focus.prev()
+ assert v.focus.focusflow == v[0]
+
+
def test_settings():
v = view.View()
f = tft()