def METHOD_NAME(self, mock_urlfetch):
    url = 'http://localhost:8080/frugal'
    buff = bytearray(4)
    pack_into('!I', buff, 0, 10)
    resp_body = b64encode(buff)
    resp = Mock(status_code=200, content=resp_body)
    mock_urlfetch.return_value = resp
    tr = TUrlfetchTransport(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_urlfetch.assert_called_once_with(
        url, encoded_frame, False, None,
        {'Content-Length': '20', 'Content-Type': 'application/x-frugal',
         'Content-Transfer-Encoding': 'base64', 'User-Agent':
         'Python/TBaseHttpTransport'},
    )