Skip to content

Commit

Permalink
style: fix pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebits committed Jun 26, 2023
1 parent 3a08094 commit 5c29eb2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/pytest_tests_collection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions deps/wazuh_testing/wazuh_testing/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
5 changes: 3 additions & 2 deletions deps/wazuh_testing/wazuh_testing/tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5c29eb2

Please sign in to comment.