MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_reversed

Function test_reversed

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

Source from the content-addressed store, hash-verified

426
427
428def test_reversed():
429 v = view.View()
430 v.requestheaders(tft(start=1))
431 v.requestheaders(tft(start=2))
432 v.requestheaders(tft(start=3))
433 v.set_reversed(True)
434
435 assert v[0].timestamp_created == 3
436 assert v[-1].timestamp_created == 1
437 assert v[2].timestamp_created == 1
438 with pytest.raises(IndexError):
439 v[5]
440 with pytest.raises(IndexError):
441 v[-5]
442
443 assert v._bisect(v[0]) == 1
444 assert v._bisect(v[2]) == 3
445
446
447def test_update():

Callers

nothing calls this directly

Calls 4

requestheadersMethod · 0.95
set_reversedMethod · 0.95
_bisectMethod · 0.95
tftFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…