MCPcopy Create free account
hub / github.com/Pylons/webtest / InputWrapper

Class InputWrapper

webtest/lint.py:209–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207
208
209class InputWrapper:
210
211 def __init__(self, wsgi_input):
212 self.input = wsgi_input
213
214 def read(self, *args):
215 assert len(args) <= 1
216 v = self.input.read(*args)
217 assert type(v) is bytes
218 return v
219
220 def readline(self, *args):
221 v = self.input.readline(*args)
222 assert type(v) is bytes
223 return v
224
225 def readlines(self, *args):
226 assert len(args) <= 1
227 lines = self.input.readlines(*args)
228 assert isinstance(lines, list)
229 for line in lines:
230 assert type(line) is bytes
231 return lines
232
233 def __iter__(self):
234 while 1:
235 line = self.readline()
236 if not line:
237 return
238 yield line
239
240 def close(self):
241 raise AssertionError("input.close() must not be called")
242
243 def seek(self, *a, **kw):
244 return self.input.seek(*a, **kw)
245
246
247class ErrorWrapper:

Callers 4

test_closeMethod · 0.90
test_iterMethod · 0.90
test_seekMethod · 0.90
lint_appFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_closeMethod · 0.72
test_iterMethod · 0.72
test_seekMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…