File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 11"""Test ClamAV configuration verification."""
22
33import argparse
4+ import io
45import pathlib
56import tempfile
7+ from contextlib import redirect_stdout
68from unittest .mock import patch
79
810from nilrt_snac ._configs ._clamav_config import _ClamAVConfig
@@ -28,10 +30,17 @@ def test_verify_not_installed(self):
2830
2931 # Mock opkg_helper to return False for all packages
3032 with patch .object (config ._opkg_helper , "is_installed" , return_value = False ):
33+ # Capture stdout to verify the skip message
34+ captured_output = io .StringIO ()
3135 args = argparse .Namespace ()
32- result = config .verify (args )
33-
36+
37+ with redirect_stdout (captured_output ):
38+ result = config .verify (args )
39+
40+ # Verify it returns True for the right reason
3441 assert result is True
42+ output = captured_output .getvalue ()
43+ assert "ClamAV is not installed; skipping verification." in output
3544
3645 def test_verify_installed_missing_config_files (self ):
3746 """Test verify when ClamAV is installed but config files missing."""
You can’t perform that action at this time.
0 commit comments