-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest_x_request_id.py
More file actions
43 lines (36 loc) · 989 Bytes
/
test_x_request_id.py
File metadata and controls
43 lines (36 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import requests
import pytest
from lib.fixtures import * # NOSONAR
from lib.constants import VALID_ENDPOINT_LETTERS, MI_ENDPOINT
from lib.generators import Generators
METHODS = ["get", "post"]
@pytest.mark.test
@pytest.mark.devtest
@pytest.mark.inttest
@pytest.mark.prodtest
@pytest.mark.parametrize("method", METHODS)
@pytest.mark.parametrize("endpoints", VALID_ENDPOINT_LETTERS)
def test_header_letters_endpoint(
url,
method,
endpoints,
bearer_token
):
resp = getattr(requests, method)(f"{url}/{endpoints}", headers={
"Authorization": bearer_token.value,
"X-Request-ID": None
})
assert resp.status_code == 500
@pytest.mark.test
@pytest.mark.devtest
@pytest.mark.inttest
@pytest.mark.prodtest
def test_header_mi_endpoint(
url,
bearer_token
):
resp = getattr(requests, "post")(f"{url}/{MI_ENDPOINT}", headers={
"Authorization": bearer_token.value,
"X-Request-ID": ""
})
assert resp.status_code == 500