MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / test_movement

Function test_movement

test/mitmproxy/addons/test_view.py:321–355  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

319
320
321def test_movement():
322 v = view.View()
323 with taddons.context():
324 v.go(0)
325 v.add(
326 [
327 tflow.tflow(),
328 tflow.tflow(),
329 tflow.tflow(),
330 tflow.tflow(),
331 tflow.tflow(),
332 ]
333 )
334 assert v.focus.index == 0
335 v.go(-1)
336 assert v.focus.index == 4
337 v.go(0)
338 assert v.focus.index == 0
339 v.go(1)
340 assert v.focus.index == 1
341 v.go(999)
342 assert v.focus.index == 4
343 v.go(-999)
344 assert v.focus.index == 0
345
346 v.focus_next()
347 assert v.focus.index == 1
348 v.focus_prev()
349 assert v.focus.index == 0
350
351 v.clear()
352 v.focus_next()
353 assert v.focus.index is None
354 v.focus_prev()
355 assert v.focus.index is None
356
357
358def test_duplicate():

Callers

nothing calls this directly

Calls 6

goMethod · 0.95
addMethod · 0.95
focus_nextMethod · 0.95
focus_prevMethod · 0.95
clearMethod · 0.95
contextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…