def test_family_inet6(self):
    self.transport.get_extra_info.side_effect = [mock.Mock(family=socket.AF_INET6), ('::', 1122, 0, 0), ('2.3.4.5', 80)]
    self.message = protocol.RawRequestMessage('GET', '/', (1, 0), self.headers, self.raw_headers, True, 'deflate')
    environ = self._make_one()
    self.assertEqual(environ['SERVER_NAME'], 'python.org')
    self.assertEqual(environ['SERVER_PORT'], '80')
    self.assertEqual(environ['REMOTE_ADDR'], '::')
    self.assertEqual(environ['REMOTE_PORT'], '1122')
def test_family_inet6(self):
    self.transport.get_extra_info.side_effect = [mock.Mock(family=socket.AF_INET6), ('::', 1122, 0, 0), ('2.3.4.5', 80)]
    self.message = protocol.RawRequestMessage('GET', '/', (1, 0), self.headers, self.raw_headers, True, 'deflate')
    environ = self._make_one()
    self.assertEqual(environ['SERVER_NAME'], 'python.org')
    self.assertEqual(environ['SERVER_PORT'], '80')
    self.assertEqual(environ['REMOTE_ADDR'], '::')
    self.assertEqual(environ['REMOTE_PORT'], '1122')