@exclude_transport('urllib3')
    def test_different_domains(self):
        g = build_grab()
        names = [
            'foo:%d:127.0.0.1' % self.server.port,
            'bar:%d:127.0.0.1' % self.server.port,
        ]
        g.transport.curl.setopt(pycurl.RESOLVE, names)

        self.server.response['cookies'] = {'foo': 'foo'}.items()
        g.go('http://foo:%d' % self.server.port)
        self.assertEqual(dict(g.response.cookies.items()), {'foo': 'foo'})

        self.server.response['cookies'] = {'bar': 'bar'}.items()
        g.go(self.server.port % 'http://bar:%d')

        # response.cookies contains cookies from both domains
        # because it just accumulates cookies over time
        self.assertEqual(dict(g.response.cookies.items()), {'foo': 'foo',
                                                            'bar': 'bar'})
dataset/ETHPy150Open lorien/grab/test/grab_cookies.py/TestCookies.test_different_domains/swapped operands of `%`