Verify case insensitivty when reading headers.
(self)
| 219 | self.assertEqual(json_rpc_reader.read_state, jsonrpc.ReadState.Content) |
| 220 | |
| 221 | def test_case_insensitive_header(self): |
| 222 | """ |
| 223 | Verify case insensitivty when reading headers. |
| 224 | """ |
| 225 | test_stream = io.BytesIO(b'CONTENT-LENGTH: 15\r\n\r\n{"key":"value"}') |
| 226 | json_rpc_reader = jsonrpc.JsonRpcReader(test_stream) |
| 227 | response = json_rpc_reader.read_response() |
| 228 | baseline = {u'key': u'value'} |
| 229 | self.assertEqual(response, baseline) |
| 230 | |
| 231 | test_stream = io.BytesIO(b'CoNtEnT-lEngTh: 15\r\n\r\n{"key":"value"}') |
| 232 | json_rpc_reader = jsonrpc.JsonRpcReader(test_stream) |
| 233 | response = json_rpc_reader.read_response() |
| 234 | baseline = {u'key': u'value'} |
| 235 | self.assertEqual(response, baseline) |
| 236 | |
| 237 | |
| 238 | if __name__ == u'__main__': |
nothing calls this directly
no test coverage detected