Attempt to patch proxy, unsuccessful

This commit is contained in:
0mar
2020-11-26 12:22:43 +01:00
parent e02345a4e8
commit 40176a667f

View File

@@ -38,13 +38,11 @@ async def test_external_proxy(request, tmpdir_factory):
internal_ssl = os.environ.get('SSL_ENABLED', False) internal_ssl = os.environ.get('SSL_ENABLED', False)
kwargs = {'config': cfg} kwargs = {'config': cfg}
if internal_ssl: if internal_ssl:
kwargs.update( kwargs['internal_ssl'] = True
dict( kwargs['internal_certs_location'] = str(tmpdir_factory.mktemp('ssl'))
internal_ssl=True,
internal_certs_location=str(tmpdir_factory.mktemp('ssl')),
)
)
app = MockHub.instance(**kwargs) app = MockHub.instance(**kwargs)
app.proxy = app.proxy_class(app=app)
# disable last_activity polling to avoid check_routes being called during the test, # disable last_activity polling to avoid check_routes being called during the test,
# which races with some of our test conditions # which races with some of our test conditions
app.last_activity_interval = 0 app.last_activity_interval = 0
@@ -71,12 +69,12 @@ async def test_external_proxy(request, tmpdir_factory):
'--log-level=debug', '--log-level=debug',
] ]
if app.internal_ssl: if app.internal_ssl:
cfg.ConfigurableHTTPProxy._append_ssl_options(cmd) app.proxy._append_ssl_options(cmd)
app.log.warn("Doing stuff here") app.log.warn("Doing stuff here")
app.log.warn(cmd) app.log.warn(cmd)
if app.subdomain_host: if app.subdomain_host:
cmd.append('--host-routing') cmd.append('--host-routing')
proxy = Popen(cmd, env=env) proxy = Popen(cmd, env=env) # Todo: Update test to use proxy instance
def _cleanup_proxy(): def _cleanup_proxy():
if proxy.poll() is None: if proxy.poll() is None: