Skip to content

Commit

Permalink
CCM-8114: Remove parametrization from tests using NHS Notify Test Cli…
Browse files Browse the repository at this point in the history
…ent 1
  • Loading branch information
Kennedy1265 committed Jan 3, 2025
1 parent b940e35 commit 4a71d34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
from lib.fixtures import * # NOSONAR
from lib.constants.messages_paths import MESSAGES_ENDPOINT
import lib.constants.constants as constants
from lib.constants.constants import CORRELATION_IDS


@pytest.mark.devtest
@pytest.mark.parametrize("correlation_id", CORRELATION_IDS)
def test_not_permitted_to_use_contact_details(nhsd_apim_proxy_url, bearer_token_internal_dev_test_1, correlation_id):
def test_not_permitted_to_use_contact_details(nhsd_apim_proxy_url, bearer_token_internal_dev_test_1):
"""
.. include:: ../../partials/validation/test_not_permitted_to_use_contact_details.rst
"""
Expand All @@ -31,7 +29,7 @@ def test_not_permitted_to_use_contact_details(nhsd_apim_proxy_url, bearer_token_
"Authorization": bearer_token_internal_dev_test_1.value,
"Accept": constants.DEFAULT_CONTENT_TYPE,
"Content-Type": constants.DEFAULT_CONTENT_TYPE,
"X-Correlation-Id": correlation_id,
"X-Correlation-Id": None,
}, json=data
)

Expand All @@ -44,5 +42,5 @@ def test_not_permitted_to_use_contact_details(nhsd_apim_proxy_url, bearer_token_
"pointer": "/data/attributes/recipient/contactDetails"
}
),
correlation_id
None
)
9 changes: 3 additions & 6 deletions tests/development/rate_limiting/test_429_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from lib.constants.messages_paths import MESSAGES_ENDPOINT
import time

CORRELATION_IDS = [None, "0f160ae2-9b62-47bf-bdf0-c6a844d59488"]

test_client_1_details = {
"email": "[email protected]",
"name": "NHS Notify Test Client 1"
Expand All @@ -26,8 +24,7 @@ def send_multiple_requests(url, headers, count=10, delay=0):


@pytest.mark.devperftest
@pytest.mark.parametrize("correlation_id", CORRELATION_IDS)
def test_429_triggered_app_quota(nhsd_apim_proxy_url, bearer_token_internal_dev, rate_limiting, correlation_id):
def test_429_triggered_app_quota(nhsd_apim_proxy_url, bearer_token_internal_dev, rate_limiting):

"""
.. include:: ../../partials/too_many_requests/test_429_global_app_quota.rst
Expand All @@ -38,7 +35,7 @@ def test_429_triggered_app_quota(nhsd_apim_proxy_url, bearer_token_internal_dev,
"Authorization": bearer_token_internal_dev.value,
"Accept": "*/*",
"Content-Type": "application/json",
"X-Correlation-Id": correlation_id
"X-Correlation-Id": None
}

resp = send_multiple_requests(default_request_url(nhsd_apim_proxy_url), headers)
Expand All @@ -49,7 +46,7 @@ def test_429_triggered_app_quota(nhsd_apim_proxy_url, bearer_token_internal_dev,
Generators.generate_quota_error_custom(
"Your application, Comms-manager-local, "
"has exceeded its quota of 4 requests every 1 minute(s) and is being rate limited."),
correlation_id
None
)

assert "Retry-After" in resp.headers
Expand Down

0 comments on commit 4a71d34

Please sign in to comment.