(self)
| 435 | |
| 436 | class HttpMethodTests(TestCase): |
| 437 | def test_invalid_method_names(self): |
| 438 | methods = ( |
| 439 | 'GET\r', |
| 440 | 'POST\n', |
| 441 | 'PUT\n\r', |
| 442 | 'POST\nValue', |
| 443 | 'POST\nHOST:abc', |
| 444 | 'GET\nrHost:abc\n', |
| 445 | 'POST\rRemainder:\r', |
| 446 | 'GET\rHOST:\n', |
| 447 | '\nPUT' |
| 448 | ) |
| 449 | |
| 450 | for method in methods: |
| 451 | with self.assertRaisesRegex( |
| 452 | ValueError, "method can't contain control characters"): |
| 453 | conn = client.HTTPConnection('example.com') |
| 454 | conn.sock = FakeSocket(None) |
| 455 | conn.request(method=method, url="/") |
| 456 | |
| 457 | |
| 458 | class TransferEncodingTest(TestCase): |
nothing calls this directly
no test coverage detected