|
9 | 9 | from wsgiref.simple_server import make_server |
10 | 10 | from io import StringIO, BytesIO, BufferedReader |
11 | 11 | from socketserver import BaseServer |
| 12 | +from platform import python_implementation |
| 13 | + |
12 | 14 | import os |
13 | 15 | import re |
14 | 16 | import sys |
@@ -129,9 +131,11 @@ def compare_generic_iter(make_it,match): |
129 | 131 | class IntegrationTests(TestCase): |
130 | 132 |
|
131 | 133 | def check_hello(self, out, has_length=True): |
| 134 | + pyver = (python_implementation() + "/" + |
| 135 | + sys.version.split()[0]) |
132 | 136 | self.assertEqual(out, |
133 | 137 | ("HTTP/1.0 200 OK\r\n" |
134 | | - "Server: WSGIServer/0.2 Python/"+sys.version.split()[0]+"\r\n" |
| 138 | + "Server: WSGIServer/0.2 " + pyver +"\r\n" |
135 | 139 | "Content-Type: text/plain\r\n" |
136 | 140 | "Date: Mon, 05 Jun 2006 18:49:54 GMT\r\n" + |
137 | 141 | (has_length and "Content-Length: 13\r\n" or "") + |
@@ -185,9 +189,11 @@ def app(e, s): |
185 | 189 | out, err = run_amock(validator(app)) |
186 | 190 | self.assertTrue(err.endswith('"GET / HTTP/1.0" 200 4\n')) |
187 | 191 | ver = sys.version.split()[0].encode('ascii') |
| 192 | + py = python_implementation().encode('ascii') |
| 193 | + pyver = py + b"/" + ver |
188 | 194 | self.assertEqual( |
189 | 195 | b"HTTP/1.0 200 OK\r\n" |
190 | | - b"Server: WSGIServer/0.2 Python/" + ver + b"\r\n" |
| 196 | + b"Server: WSGIServer/0.2 "+ pyver + b"\r\n" |
191 | 197 | b"Content-Type: text/plain; charset=utf-8\r\n" |
192 | 198 | b"Date: Wed, 24 Dec 2008 13:29:32 GMT\r\n" |
193 | 199 | b"\r\n" |
|
0 commit comments