Skip to content

Commit b814f7f

Browse files
committed
CM-53944-Fixed tests import format
1 parent d7e5104 commit b814f7f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/cli/files_collector/test_file_excluder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import pytest
22

33
from cycode.cli import consts
4-
from cycode.cli.files_collector.file_excluder import _is_file_relevant_for_sca_scan
5-
from cycode.cli.files_collector.file_excluder import Excluder
4+
from cycode.cli.files_collector.file_excluder import Excluder, _is_file_relevant_for_sca_scan
65

76
class TestIsFileRelevantForScaScan:
87
"""Test the SCA path exclusion logic."""
@@ -39,15 +38,16 @@ def test_files_with_excluded_names_in_filename_should_be_included(self) -> None:
3938
assert _is_file_relevant_for_sca_scan('config/gradle_config.xml') is True
4039

4140
def test_files_with_excluded_extensions_in_should_be_included(self) -> None:
42-
"""Test that files containing excluded directory names in their filename are NOT excluded."""
43-
# These should be INCLUDED because the excluded terms are in the filename, not directory path
41+
"""Test that files containing excluded extensions are NOT excluded."""
4442
excluder = Excluder()
43+
# These should be INCLUDED because the excluded terms are in the filename
4544
assert excluder._is_relevant_file_to_scan_common('iac','project/cfg/Dockerfile') is True
4645
assert excluder._is_relevant_file_to_scan_common('iac','project/cfg/build.tf') is True
4746
assert excluder._is_relevant_file_to_scan_common('iac', 'project/cfg/build.tf.json') is True
4847
assert excluder._is_relevant_file_to_scan_common('iac', 'project/cfg/config.json') is True
4948
assert excluder._is_relevant_file_to_scan_common('iac', 'project/cfg/config.yaml') is True
5049
assert excluder._is_relevant_file_to_scan_common('iac', 'project/cfg/config.yml') is True
50+
# These should be EXCLUDED because the excluded terms are not in the filename
5151
assert excluder._is_relevant_file_to_scan_common('iac','project/cfg/build') is False
5252
assert excluder._is_relevant_file_to_scan_common('iac', 'project/cfg/build') is False
5353
assert excluder._is_relevant_file_to_scan_common('iac', 'project/cfg/Dockerfile.txt') is False

0 commit comments

Comments
 (0)