MCPcopy Index your code
hub / github.com/python/cpython / test_bytes_validation

Method test_bytes_validation

Lib/test/test_wsgiref.py:195–214  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

193 )
194
195 def test_bytes_validation(self):
196 def app(e, s):
197 s("200 OK", [
198 ("Content-Type", "text/plain; charset=utf-8"),
199 ("Date", "Wed, 24 Dec 2008 13:29:32 GMT"),
200 ])
201 return [b"data"]
202 out, err = run_amock(validator(app))
203 self.assertEndsWith(err, '"GET / HTTP/1.0" 200 4\n')
204 ver = sys.version.split()[0].encode('ascii')
205 py = python_implementation().encode('ascii')
206 pyver = py + b"/" + ver
207 self.assertEqual(
208 b"HTTP/1.0 200 OK\r\n"
209 b"Server: WSGIServer " + pyver + b"\r\n"
210 b"Content-Type: text/plain; charset=utf-8\r\n"
211 b"Date: Wed, 24 Dec 2008 13:29:32 GMT\r\n"
212 b"\r\n"
213 b"data",
214 out)
215
216 def test_cp1252_url(self):
217 def app(e, s):

Callers

nothing calls this directly

Calls 7

validatorFunction · 0.90
python_implementationFunction · 0.90
run_amockFunction · 0.85
assertEndsWithMethod · 0.80
encodeMethod · 0.45
splitMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected