MCPcopy
hub / github.com/pallets/flask / test_run_cert_adhoc

Function test_run_cert_adhoc

tests/test_cli.py:602–616  ·  view source on GitHub ↗
(monkeypatch)

Source from the content-addressed store, hash-verified

600
601
602def test_run_cert_adhoc(monkeypatch):
603 monkeypatch.setitem(sys.modules, "cryptography", None)
604
605 # cryptography not installed
606 with pytest.raises(click.BadParameter):
607 run_command.make_context("run", ["--cert", "adhoc"])
608
609 # cryptography installed
610 monkeypatch.setitem(sys.modules, "cryptography", types.ModuleType("cryptography"))
611 ctx = run_command.make_context("run", ["--cert", "adhoc"])
612 assert ctx.params["cert"] == "adhoc"
613
614 # no key with adhoc
615 with pytest.raises(click.BadParameter):
616 run_command.make_context("run", ["--cert", "adhoc", "--key", __file__])
617
618
619def test_run_cert_import(monkeypatch):

Callers

nothing calls this directly

Calls 1

make_contextMethod · 0.80

Tested by

no test coverage detected