'L{HTTPChannel} provides username and password information supplied in
an I{Authorization} header to the L{Request} which makes it available
via its C{getUser} and C{getPassword} methods.'

def test_basicAuth(self):

    requests = []
    class Request(http.Request, ):
        def process(self):
            self.credentials = (self.getUser(), self.getPassword())
            requests.append(self)
    for (u, p) in [('foo', 'bar'), ('hello', 'there:z')]:
        s = base64.encodestring(':'.join((u, p))).strip()
        f = (('GET    /    HTTP/1.0\nAuthorization:    Basic    ' + s) + '\n\n')
        self.runRequest(f, Request, 0)
        req = requests.pop()
        self.assertEqual((u, p), req.credentials)
