def METHOD_NAME(self, mock_requests):
    url = 'http://localhost:8080/frugal'
    headers = {'foo': 'bar'}
    resp = Mock(status_code=200)
    response = b'response'
    buff = bytearray(4)
    pack_into('!I', buff, 0, len(response))
    resp.content = b64encode(buff + response)
    mock_requests.post.return_value = resp
    def get_headers():
        return {'baz': 'qux'}
    tr = THttpTransport(url, headers=headers, get_headers=get_headers,
                        response_capacity=500)
    tr.open()
    self.assertTrue(tr.isOpen())
    data = b'helloworld'
    buff = bytearray(4)
    pack_into('!I', buff, 0, len(data))
    encoded_frame = b64encode(buff + data)
    tr.set_timeout(5000)
    tr.write(data)
    tr.flush()
    mock_requests.post.assert_called_once_with(
        url, data=encoded_frame, timeout=5,
        headers={'foo': 'bar', 'baz': 'qux', 'Content-Length': '20',
                 'Content-Type': 'application/x-frugal',
                 'Content-Transfer-Encoding': 'base64',
                 'User-Agent': 'Python/TBaseHttpTransport',
                 'x-frugal-payload-limit': '500'})
    resp = tr.read(len(response))
    self.assertEqual(response, resp)
    tr.close()
    self.assertTrue(tr.isOpen())  # open/close are no-ops