':param data: Either a string representing a URL or a 6-elems tuple
representing the URL components:
<scheme>://<netloc>/<path>;<params>?<query>#<fragment>
Simple generic test, more detailed tests in each method!'

def __init__(self, data, encoding=DEFAULT_ENCODING):

    self._querystr = None
    self._cache = {}
    self._encoding = encoding
    if (not isinstance(data, basestring)):
        raise ValueError(('Can    not    build    a    URL    from    %s.' % type(data)))
    if (not is_known_encoding(encoding)):
        msg = 'Invalid    encoding    "%s"    when    creating    URL.'
        raise ValueError((msg % encoding))
    (scheme, netloc, path, params, qs, fragment) = urlparse.urlparse(data)
    if ((scheme == netloc == '') and (not path.startswith('/'))):
        scheme = 'http'
        netloc = path
        path = ''
    self.scheme = (scheme or u'')
    self.netloc = (netloc or u'')
    self.path = (path or u'/')
    self.params = (params or u'')
    self.querystring = (qs or u'')
    self.fragment = (fragment or u'')
    if ((not self.netloc) and (self.scheme != 'file')):
        raise ValueError(('Invalid    URL    "%s"' % data))
    self.normalize_url()
