MCPcopy Create free account
hub / github.com/dbcli/mycli / test_init_reports_invalid_ssl_mode

Function test_init_reports_invalid_ssl_mode

test/pytests/test_client.py:27–42  ·  view source on GitHub ↗
(monkeypatch: pytest.MonkeyPatch, tmp_path: Path)

Source from the content-addressed store, hash-verified

25
26
27def test_init_reports_invalid_ssl_mode(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
28 patch_constructor_side_effects(monkeypatch)
29 echo_calls: list[tuple[str, dict[str, Any]]] = []
30 monkeypatch.setattr(MyCli, 'echo', lambda self, message, **kwargs: echo_calls.append((message, kwargs)))
31 myclirc = write_myclirc(
32 tmp_path,
33 """
34 [connection]
35 default_ssl_mode = invalid
36 """,
37 )
38
39 cli = MyCli(myclirc=myclirc)
40
41 assert cli.ssl_mode is None
42 assert echo_calls == [('Invalid config option provided for ssl_mode (invalid); ignoring.', {'err': True, 'fg': 'red'})]
43
44
45def test_init_honors_explicit_show_warnings(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:

Callers

nothing calls this directly

Calls 3

MyCliClass · 0.90
write_myclircFunction · 0.85

Tested by

no test coverage detected