(self)
| 389 | |
| 390 | class HttpMethodTests(TestCase): |
| 391 | def test_invalid_method_names(self): |
| 392 | methods = ( |
| 393 | 'GET\r', |
| 394 | 'POST\n', |
| 395 | 'PUT\n\r', |
| 396 | 'POST\nValue', |
| 397 | 'POST\nHOST:abc', |
| 398 | 'GET\nrHost:abc\n', |
| 399 | 'POST\rRemainder:\r', |
| 400 | 'GET\rHOST:\n', |
| 401 | '\nPUT' |
| 402 | ) |
| 403 | |
| 404 | for method in methods: |
| 405 | with self.assertRaisesRegex( |
| 406 | ValueError, "method can't contain control characters"): |
| 407 | conn = client.HTTPConnection('example.com') |
| 408 | conn.sock = FakeSocket(None) |
| 409 | conn.request(method=method, url="/") |
| 410 | |
| 411 | |
| 412 | class TransferEncodingTest(TestCase): |
nothing calls this directly
no test coverage detected