(tmp_path: Path)
| 60 | |
| 61 | |
| 62 | def test_storage_settings_roundtrip(tmp_path: Path): |
| 63 | db_path = tmp_path / "reports.db" |
| 64 | init_db(db_path) |
| 65 | |
| 66 | set_setting("runtime.timeout", "4", db_path=db_path) |
| 67 | set_setting("runtime.threads", "120", db_path=db_path) |
| 68 | set_setting("api.shodan", None, db_path=db_path) |
| 69 | |
| 70 | assert get_setting("runtime.timeout", db_path=db_path) == "4" |
| 71 | assert get_setting("runtime.threads", db_path=db_path) == "120" |
| 72 | assert get_setting("api.shodan", db_path=db_path) is None |
| 73 | assert get_setting("missing", db_path=db_path) is None |
| 74 | |
| 75 | all_settings = get_settings(db_path=db_path) |
| 76 | assert all_settings["runtime.timeout"] == "4" |
| 77 | assert all_settings["runtime.threads"] == "120" |
| 78 | assert "api.shodan" in all_settings |
| 79 | |
| 80 | runtime_only = get_settings(prefix="runtime.", db_path=db_path) |
| 81 | assert sorted(runtime_only.keys()) == ["runtime.threads", "runtime.timeout"] |
| 82 | |
| 83 | |
| 84 | def test_storage_reset_reports_returns_deleted_count(tmp_path: Path): |
nothing calls this directly
no test coverage detected