Skip to content

Commit 7a64fcb

Browse files
hemant-jadhav-emersonAlexHearnNI
authored andcommitted
skipping verification updated to use logger output.
Signed-off-by: Hemant Jadhav <hemant.jadhav@emerson.com>
1 parent 40bd4d6 commit 7a64fcb

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/integration/test_clamav_config.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
"""Test ClamAV configuration verification."""
22

33
import argparse
4+
import io
45
import pathlib
56
import tempfile
7+
from contextlib import redirect_stdout
68
from unittest.mock import patch
79

810
from 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."""

0 commit comments

Comments
 (0)