def METHOD_NAME(self, mock_requests):
    url = 'http://localhost:8080/frugal'
    resp = Mock(status_code=200)
    buff = bytearray(4)
    pack_into('!I', buff, 0, 10)
    resp.content = b64encode(buff)
    mock_requests.post.return_value = resp
    tr = THttpTransport(url)
    data = b'helloworld'
    buff = bytearray(4)
    pack_into('!I', buff, 0, len(data))
    encoded_frame = b64encode(buff + data)
    tr.write(data)
    with self.assertRaises(TTransportException):
        tr.flush()
    mock_requests.post.assert_called_once_with(
        url, data=encoded_frame, timeout=None,
        headers={'Content-Length': '20',
                 'Content-Type': 'application/x-frugal',
                 'Content-Transfer-Encoding': 'base64',
                 'User-Agent': 'Python/TBaseHttpTransport'})