()
| 98 | |
| 99 | |
| 100 | def test_simple(): |
| 101 | v = view.View() |
| 102 | f = tft(start=1) |
| 103 | assert v.store_count() == 0 |
| 104 | v.requestheaders(f) |
| 105 | assert list(v) == [f] |
| 106 | assert v.get_by_id(f.id) |
| 107 | assert not v.get_by_id("nonexistent") |
| 108 | |
| 109 | # These all just call update |
| 110 | v.error(f) |
| 111 | v.response(f) |
| 112 | v.intercept(f) |
| 113 | v.resume(f) |
| 114 | v.kill(f) |
| 115 | assert list(v) == [f] |
| 116 | |
| 117 | v.requestheaders(f) |
| 118 | assert list(v) == [f] |
| 119 | assert len(v._store) == 1 |
| 120 | assert v.store_count() == 1 |
| 121 | |
| 122 | f2 = tft(start=3) |
| 123 | v.requestheaders(f2) |
| 124 | assert list(v) == [f, f2] |
| 125 | v.requestheaders(f2) |
| 126 | assert list(v) == [f, f2] |
| 127 | assert len(v._store) == 2 |
| 128 | |
| 129 | assert v.inbounds(0) |
| 130 | assert not v.inbounds(-1) |
| 131 | assert not v.inbounds(100) |
| 132 | |
| 133 | f3 = tft(start=2) |
| 134 | v.requestheaders(f3) |
| 135 | assert list(v) == [f, f3, f2] |
| 136 | v.requestheaders(f3) |
| 137 | assert list(v) == [f, f3, f2] |
| 138 | assert len(v._store) == 3 |
| 139 | |
| 140 | f.marked = not f.marked |
| 141 | f2.marked = not f2.marked |
| 142 | v.clear_not_marked() |
| 143 | assert list(v) == [f, f2] |
| 144 | assert len(v) == 2 |
| 145 | assert len(v._store) == 2 |
| 146 | |
| 147 | v.clear() |
| 148 | assert len(v) == 0 |
| 149 | assert len(v._store) == 0 |
| 150 | |
| 151 | |
| 152 | def test_simple_tcp(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…