From 5c29eb2dc7452e51aec6309101018b354144a4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Mon, 26 Jun 2023 10:28:51 +0100 Subject: [PATCH] style: fix pep8 --- .github/workflows/pytest_tests_collection.yaml | 6 +++++- deps/wazuh_testing/wazuh_testing/tools/__init__.py | 6 +++--- deps/wazuh_testing/wazuh_testing/tools/utils.py | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pytest_tests_collection.yaml b/.github/workflows/pytest_tests_collection.yaml index 6c3670bcc8..5ec8d03baf 100644 --- a/.github/workflows/pytest_tests_collection.yaml +++ b/.github/workflows/pytest_tests_collection.yaml @@ -33,13 +33,17 @@ jobs: id: set-changed-modules run: | files_changed="${{ steps.changed-files.outputs.all_changed_files }}" - DIRECTORIES=$(echo $files_changed | tr ' ' '\n' | grep ^tests | grep -v pytest.ini | cut -d/ -f2 | uniq | tr -d ' ') + DIRECTORIES=$(echo $files_changed | tr ' ' '\n' | grep ^tests | grep -v pytest.ini | cut -d/ -f2 | \ + uniq | tr -d ' ') DIRECTORIES=$(echo $DIRECTORIES | tr ' ' ',') echo "matrix=$DIRECTORIES" >> $GITHUB_OUTPUT +# yamllint disable rule:wrong-indentation - name: Collect tests run: | DIRECTORIES=$(echo ${{ steps.set-changed-modules.outputs.matrix }} | tr ',' ' ') for directory in $DIRECTORIES; do pytest --collect-only tests/${directory} done + +# yamllint enable rule:wrong-indentation \ No newline at end of file diff --git a/deps/wazuh_testing/wazuh_testing/tools/__init__.py b/deps/wazuh_testing/wazuh_testing/tools/__init__.py index 83545f0225..6d42379944 100644 --- a/deps/wazuh_testing/wazuh_testing/tools/__init__.py +++ b/deps/wazuh_testing/wazuh_testing/tools/__init__.py @@ -112,9 +112,9 @@ def get_service(): else: service = 'N/A' else: # Linux, sunos5, darwin, aix... - output = subprocess.check_output([f"{WAZUH_PATH}/bin/wazuh-control", "info", "-t"], - stderr=subprocess.PIPE).decode('utf-8').strip() - service = 'wazuh-manager' if output == 'server' else 'wazuh-agent' + output = subprocess.check_output([f"{WAZUH_PATH}/bin/wazuh-control", "info", "-t"], + stderr=subprocess.PIPE).decode('utf-8').strip() + service = 'wazuh-manager' if output == 'server' else 'wazuh-agent' except Exception: service = 'N/A' diff --git a/deps/wazuh_testing/wazuh_testing/tools/utils.py b/deps/wazuh_testing/wazuh_testing/tools/utils.py index 884d2b602c..3b17d51fd3 100644 --- a/deps/wazuh_testing/wazuh_testing/tools/utils.py +++ b/deps/wazuh_testing/wazuh_testing/tools/utils.py @@ -163,12 +163,13 @@ def get_host_name(): def validate_interval_format(interval): """Validate that the interval passed has the format in which the last digit is a letter from those passed and the other characters are between 0-9""" - if interval=='': + if interval == '': return False - if interval[-1] not in ['s','m', 'h','d','w','y'] or not isinstance(int(interval[0:-1]), numbers.Number): + if interval[-1] not in ['s', 'm', 'h', 'd', 'w', 'y'] or not isinstance(int(interval[0:-1]), numbers.Number): return False return True + def format_ipv6_long(ipv6_address): """Return the long form of the address representation in uppercase.