Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
The `is_rule_dir` function is a part of `ssg.rules` module, it doesn't need
to be transitively imported through `ssg_test_suite.common`, but it can be
imported directly.

Also, remove unused imports.
  • Loading branch information
jan-cerny committed Jan 21, 2025
1 parent 4ca2865 commit cdef6e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/ssg_test_suite/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from ssg.constants import OSCAP_RULE
from ssg.jinja import process_file_with_macros
from ssg.products import product_yaml_path, load_product_yaml
from ssg.rules import get_rule_dir_yaml, is_rule_dir
from ssg.rules import get_rule_dir_yaml
from ssg.utils import mkdir_p
from ssg_test_suite.log import LogHelper

Expand Down
5 changes: 2 additions & 3 deletions tests/ssg_test_suite/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@
import os.path
import re
import shutil
import subprocess
import tempfile

from ssg.constants import OSCAP_PROFILE, OSCAP_PROFILE_ALL_ID, OSCAP_RULE
from ssg.jinja import process_file_with_macros
from ssg.rules import is_rule_dir

from ssg_test_suite import oscap
from ssg_test_suite import xml_operations
from ssg_test_suite import test_env
from ssg_test_suite import common
from ssg_test_suite.log import LogHelper

import ssg.templates

Rule = collections.namedtuple(
"Rule",
Expand Down Expand Up @@ -304,7 +303,7 @@ def _get_rules_to_test(self):

for dirpath, dirnames, filenames in common.walk_through_benchmark_dirs(
product):
if not common.is_rule_dir(dirpath):
if not is_rule_dir(dirpath):
continue
short_rule_id = os.path.basename(dirpath)
full_rule_id = OSCAP_RULE + short_rule_id
Expand Down

0 comments on commit cdef6e5

Please sign in to comment.