def test_family_unix(self):
    if (not hasattr(socket, 'AF_UNIX')):
        self.skipTest('No UNIX address family. (Windows?)')
    self.transport.get_extra_info.side_effect = [mock.Mock(family=socket.AF_UNIX)]
    headers = multidict.MultiDict({'SERVER_NAME': '0.0.0.0', 'SERVER_PORT': '5678', 'REMOTE_ADDR': '0.0.0.0', 'REMOTE_PORT': '8765'})
    self.message = protocol.RawRequestMessage('GET', '/', (1, 0), headers, self.raw_headers, True, 'deflate')
    environ = self._make_one()
    self.assertEqual(environ['SERVER_NAME'], '0.0.0.0')
    self.assertEqual(environ['SERVER_PORT'], '5678')
    self.assertEqual(environ['REMOTE_ADDR'], '0.0.0.0')
    self.assertEqual(environ['REMOTE_PORT'], '8765')
def test_family_unix(self):
    if (not hasattr(socket, 'AF_UNIX')):
        self.skipTest('No UNIX address family. (Windows?)')
    self.transport.get_extra_info.side_effect = [mock.Mock(family=socket.AF_UNIX)]
    headers = multidict.MultiDict({'SERVER_NAME': '0.0.0.0', 'SERVER_PORT': '5678', 'REMOTE_ADDR': '0.0.0.0', 'REMOTE_PORT': '8765'})
    self.message = protocol.RawRequestMessage('GET', '/', (1, 0), headers, self.raw_headers, True, 'deflate')
    environ = self._make_one()
    self.assertEqual(environ['SERVER_NAME'], '0.0.0.0')
    self.assertEqual(environ['SERVER_PORT'], '5678')
    self.assertEqual(environ['REMOTE_ADDR'], '0.0.0.0')
    self.assertEqual(environ['REMOTE_PORT'], '8765')