'Example text to be turned into a normalized base string uri::
GET /?q=1 HTTP/1.1
Host: www.example.net:8080
Sample string generated::
https://www.example.net:8080/'

def test_normalize_base_string_uri(self):

    uri = 'www.example.com:8080'
    self.assertRaises(ValueError, normalize_base_string_uri, uri)
    uri = u'www.example.com:8080'
    self.assertRaises(ValueError, normalize_base_string_uri, uri)
    uri = u'http://www.example.com:80/'
    self.assertEqual(normalize_base_string_uri(uri), u'http://www.example.com/')
    uri = u'http://www.example.com'
    self.assertEqual(normalize_base_string_uri(uri), u'http://www.example.com/')
    uri = u'/a-host-relative-uri'
    host = u'www.example.com'
    self.assertRaises(ValueError, normalize_base_string_uri, (uri, host))
    uri = u'http://www.example.com/a-path'
    host = u'alternatehost.example.com'
    self.assertEqual(normalize_base_string_uri(uri, host), u'http://alternatehost.example.com/a-path')
