(monkeypatch: pytest.MonkeyPatch, tmp_path: Path)
| 25 | |
| 26 | |
| 27 | def 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 | |
| 45 | def test_init_honors_explicit_show_warnings(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None: |
nothing calls this directly
no test coverage detected