MCPcopy Index your code
hub / github.com/plotly/dash / test_proxy_failure

Function test_proxy_failure

tests/unit/test_configs.py:382–406  ·  view source on GitHub ↗
(mocker, empty_environ)

Source from the content-addressed store, hash-verified

380
381
382def test_proxy_failure(mocker, empty_environ):
383 app = Dash()
384
385 # if the tests work we'll never get to server.run, but keep the mock
386 # in case something is amiss and we don't get an exception.
387 mocker.patch.object(app.server, "run")
388
389 with pytest.raises(_exc.ProxyError) as excinfo:
390 app.run(
391 proxy="https://127.0.0.1:8055::http://plot.ly", host="127.0.0.1", port=8055
392 )
393 assert "protocol: http is incompatible with the proxy" in excinfo.exconly()
394 assert "you must use protocol: https" in excinfo.exconly()
395
396 with pytest.raises(_exc.ProxyError) as excinfo:
397 app.run(
398 proxy="http://0.0.0.0:8055::http://plot.ly", host="127.0.0.1", port=8055
399 )
400 assert "host: 127.0.0.1 is incompatible with the proxy" in excinfo.exconly()
401 assert "you must use host: 0.0.0.0" in excinfo.exconly()
402
403 with pytest.raises(_exc.ProxyError) as excinfo:
404 app.run(proxy="http://0.0.0.0:8155::http://plot.ly", host="0.0.0.0", port=8055)
405 assert "port: 8055 is incompatible with the proxy" in excinfo.exconly()
406 assert "you must use port: 8155" in excinfo.exconly()
407
408
409def test_title():

Callers

nothing calls this directly

Calls 2

runMethod · 0.95
DashClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…