

def test_body(self):
    wsgi_input_mock = MagicMock()
    wsgi_input_mock.read.return_value = b'{"key1": "value1"}'
    request = Request({
        'REQUEST_METHOD': 'POST',
        'QUERY_STRING': '',
        'wsgi.input': wsgi_input_mock,
        'CONTENT_TYPE': 'application/json',
        'CONTENT_LENGTH': len(b'{"key1": "value1"}'),
    })
    self.assertEqual(request.body, '{"key1": "value1"}')

dataset/ETHPy150Open c-bata/kobin/tests/test_environs.py RequestTests.test_body/original