MCPcopy
hub / github.com/benoitc/gunicorn / match_readlines

Method match_readlines

tests/treq.py:211–227  ·  view source on GitHub ↗

\ This skips the sizes checks as we don't implement it.

(self, req, body, sizes)

Source from the content-addressed store, hash-verified

209 raise AssertionError("Read data after body finished: %r" % data)
210
211 def match_readlines(self, req, body, sizes):
212 """\
213 This skips the sizes checks as we don't implement it.
214 """
215 data = req.body.readlines()
216 for line in data:
217 if b'\n' in line[:-1]:
218 raise AssertionError("Embedded new line: %r" % line)
219 if line != body[:len(line)]:
220 raise AssertionError("Invalid body data read: %r != %r" % (
221 line, body[:len(line)]))
222 body = body[len(line):]
223 if body:
224 raise AssertionError("Failed to read entire body: %r" % body)
225 data = req.body.readlines(sizes())
226 if data:
227 raise AssertionError("Read data after body finished: %r" % data)
228
229 def match_iter(self, req, body, sizes):
230 """\

Callers

nothing calls this directly

Calls 1

readlinesMethod · 0.45

Tested by

no test coverage detected