Skip to content

Commit

Permalink
fix(#4047): fix duplicated slash in API endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Selutario committed Mar 23, 2023
1 parent e84230a commit 60de21a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Release report: TBD
- Fix error in requirements.txt ([#3689](https:/wazuh/wazuh-qa/pull/3689)) \- (Framework)
- Fix sleep time in `test_agent_default_group_added`. ([#3692](https:/wazuh/wazuh-qa/pull/3692)) \- (Tests)
- Fix syscollector deltas integration tests. ([#3695](https:/wazuh/wazuh-qa/pull/3695)) \- (Tests)
- Fix test_response_postprocessing: duplicated slash in API endpoints ([#4048](https:/wazuh/wazuh-qa/pull/4048)) \- (Tests)

### Removed

Expand Down
8 changes: 5 additions & 3 deletions tests/integration/test_api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

import os
import shutil

import pytest

import wazuh_testing as fw
from wazuh_testing import api
from wazuh_testing.tools.file import truncate_file
from wazuh_testing.tools.monitoring import FileMonitor
from wazuh_testing.tools import services as svcs
from wazuh_testing.modules.api import event_monitor as evm
from wazuh_testing.tools import configuration as conf
from wazuh_testing.tools import services as svcs
from wazuh_testing.tools.file import truncate_file
from wazuh_testing.tools.monitoring import FileMonitor


@pytest.fixture(scope='module')
Expand Down Expand Up @@ -144,6 +145,7 @@ def restart_api_module(request):

# Start Wazuh API
svcs.control_service('start')
evm.check_api_start_log(file_monitor)


@pytest.fixture(scope='module')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_response_postprocessing(restart_api_module, get_api_details, method, en
headers = api_details['auth_headers'] if use_login_token else api.get_login_headers('wrong_user', 'wrong_password')

# Make an API request
response = getattr(requests, method.lower())(f"{api_details['base_url']}/{endpoint_url}", headers=headers,
response = getattr(requests, method.lower())(f"{api_details['base_url']}{endpoint_url}", headers=headers,
verify=False, json=json_body)

assert response.headers['Content-Type'] == 'application/problem+json; charset=utf-8'
Expand Down

0 comments on commit 60de21a

Please sign in to comment.