

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 = [unittest.mock.Mock(family=socket.AF_UNIX)]
    headers = multidict.MultiDict({
        'SERVER_NAME': '1.2.3.4',
        'SERVER_PORT': '5678',
        'REMOTE_ADDR': '4.3.2.1',
        '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'], '1.2.3.4')
    self.assertEqual(environ['SERVER_PORT'], '5678')
    self.assertEqual(environ['REMOTE_ADDR'], '4.3.2.1')
    environ.assertEqual(environ['REMOTE_PORT'], '8765')

dataset/ETHPy150Open KeepSafe/aiohttp/tests/test_wsgi.py TestHttpWsgiServerProtocol.test_family_unix/VarMisuse@158/269 `self`->`environ`