Skip to content

Commit

Permalink
style(#3969): fit pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebits committed Feb 21, 2023
1 parent 6112ee1 commit 5f3d01f
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ def pytest_addoption(parser):
help="Avoid tests deselection based on current environment"
)


def pytest_configure(config):
# Register an additional marker
config.addinivalue_line(
Expand Down Expand Up @@ -390,7 +391,6 @@ def pytest_configure(config):
global_parameters.avoid_platform_based_deselection = config.getoption("--avoid-platform-based-deselection")



def pytest_html_results_table_header(cells):
cells.insert(4, html.th('Tier', class_='sortable tier', col='tier'))
cells.insert(3, html.th('Markers'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def wait_unable_to_connect(line):
return line
return None


@pytest.fixture(scope="module")
def change_timeout():
"""Set agent.recv_timeout for agentd in local internal options file.
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_agentd/test_agentd_reconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def teardown():
if remoted_server is not None:
remoted_server.stop()


@pytest.fixture(scope="module", autouse=True)
def set_debug_mode():
"""Set debug2 for agentd in local internal options file."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@

configurations = load_wazuh_configurations(configurations_path, __name__, params=p, metadata=m)

# Preparing

# Preparing
@pytest.fixture(scope='module', autouse=True)
def truncate_logs():
"""Truncate the 'ossec.log' file."""
Expand Down Expand Up @@ -181,4 +181,4 @@ def test_interval(get_configuration, configure_environment, reset_ossec_log, dae
'"Starting fetching of logs" event').result()
end_time = time.time()
diff_time = int(end_time - start_time)
assert time_interval - diff_time <= 10
assert time_interval - diff_time <= 10
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@

configurations = load_wazuh_configurations(configurations_path, __name__, params=p, metadata=m)

# Preparing

# Preparing
@pytest.fixture(scope='module', autouse=True)
def truncate_logs():
"""Truncate the 'ossec.log' file."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def truncate_logs():
"""Truncate the 'ossec.log' file."""
truncate_file(LOG_FILE_PATH)

# fixtures

# fixtures
@pytest.fixture(scope='module', params=configurations)
def get_configuration(request):
"""Get configurations from the module."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def test_integratord_read_valid_alerts(configuration, metadata, replace_configur
@pytest.mark.tier(level=1)
@pytest.mark.parametrize('configuration, metadata',
zip(t2_configurations, t2_configuration_metadata), ids=t2_case_ids)
def test_integratord_read_invalid_alerts(configuration, metadata, replace_configuration_api_key, set_wazuh_configuration, truncate_monitored_files,
def test_integratord_read_invalid_alerts(configuration, metadata, replace_configuration_api_key,
set_wazuh_configuration, truncate_monitored_files,
configure_local_internal_options_module, restart_wazuh_daemon_function,
wait_for_start_module):
'''
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_wpk/test_wpk_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def test_wpk_agent(get_configuration, prepare_agent_version, download_wpk,
remoted_simulator.change_default_listener = True

event = wazuh_log_monitor.start(timeout=timeout_ack_response, error_message='ACK event not received',
callback=callback_detect_upgrade_ack_event).result()
callback=callback_detect_upgrade_ack_event).result()
result = event['parameters']

if result is not None:
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/test_wpk/test_wpk_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@
time_until_ask_upgrade_result = 30
max_upgrade_result_status_retries = 30



version_to_upgrade = global_parameters.wpk_version[0] if global_parameters.wpk_version else 'v4.4.0'

MANAGER_VERSION = get_version()
Expand Down
7 changes: 3 additions & 4 deletions tests/integration/test_wpk/test_wpk_manager_task_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,9 @@ def test_wpk_manager_task_states(get_configuration, configure_environment,

# Chech that result of first attempt is Success
assert new_expected_response[agents_id.index(agent_id)] == \
response['data'][0]['message'], \
f'New upgrade response did not match expected! ' \
f'Expected {new_expected_response} obtained ' \
f'{response["data"][0]["message"]}'
response['data'][0]['message'], f'New upgrade response did not match expected! ' \
f'Expected {new_expected_response} obtained ' \
f'{response["data"][0]["message"]}'

for injector in injectors:
injector.stop_receive()
Expand Down
3 changes: 2 additions & 1 deletion tests/performance/test_api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def pytest_html_results_table_row(report, cells):
cells[2] = HTMLStyle.colored_td(report.user_properties[0][1])
cells[3] = HTMLStyle.colored_td(str(report.user_properties[2][1]))
cells.append(HTMLStyle.colored_td(str(report.user_properties[3][1])))
cells.append(HTMLStyle.colored_td(u'\u2713' if len(report.user_properties) > 4 and report.user_properties[4][1] else ''))
cells.append(HTMLStyle.colored_td(u'\u2713' if len(report.user_properties) > 4 and report.user_properties[4][1]
else ''))
cells.append(HTMLStyle.colored_td(f'{report.duration:.3f} s'))

except AttributeError:
Expand Down

0 comments on commit 5f3d01f

Please sign in to comment.