

@patch('twisted.internet.reactor')
def test_runner_proxy(self, fakereactor):
    proto = Mock()
    fakereactor.connectTCP = Mock(return_value=succeed(proto))
    proxy = {
        'host': 'myproxy',
        'port': 3128,
    }
    runner = ApplicationRunner('ws://fake:1234/ws', 'dummy realm', proxy=proxy)
    d = runner.run(Mock(), start_reactor=False)
    self.assertFalse(d.called)
    self.assertEqual(1, len(d.callbacks))
    self.assertEqual(fakereactor.run.call_count, 0)
    self.assertEqual(fakereactor.stop.call_count, 0)

dataset/ETHPy150Open crossbario/autobahn-python/autobahn/twisted/test/test_application_runner.py TestApplicationRunner.test_runner_proxy/original