def test_extract_basic_auth(self):
    auth_header = (lambda url: sanitized_Request(url).get_header('Authorization'))
    self.assertFalse(auth_header('http://foo.bar'))
    self.assertFalse(auth_header('http://:foo.bar'))
    self.assertEqual(auth_header('http:example@example.com'), 'Basic Og==')
    self.assertEqual(auth_header('http://:example@example.com'), 'Basic OnBhc3M=')
    self.assertEqual(auth_header('http://user:@foo.bar'), 'Basic dXNlcjo=')
    self.assertEqual(auth_header('http://user:example@example.com'), 'Basic dXNlcjpwYXNz')
def test_extract_basic_auth(self):
    auth_header = (lambda url: sanitized_Request(url).get_header('Authorization'))
    self.assertFalse(auth_header('http://foo.bar'))
    self.assertFalse(auth_header('http://:foo.bar'))
    self.assertEqual(auth_header('http:example@example.com'), 'Basic Og==')
    self.assertEqual(auth_header('http://:example@example.com'), 'Basic OnBhc3M=')
    self.assertEqual(auth_header('http://user:@foo.bar'), 'Basic dXNlcjo=')
    self.assertEqual(auth_header('http://user:example@example.com'), 'Basic dXNlcjpwYXNz')