Skip to content

Commit 0432e64

Browse files
committed
Use CaseInsensitiveDicts where appropriate [skip ci]
1 parent 4ba2445 commit 0432e64

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

tests/mock_vws/test_authorization_header.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import pytest
99
import requests
1010
from requests import codes
11+
from requests.structures import CaseInsensitiveDict
1112

1213
from mock_vws._constants import ResultCodes
1314
from tests.mock_vws.utils import Endpoint
@@ -39,7 +40,7 @@ def test_missing(self, endpoint: Endpoint) -> None:
3940

4041
headers.pop('Authorization', None)
4142

42-
endpoint.prepared_request.headers = headers
43+
endpoint.prepared_request.headers = CaseInsensitiveDict(data=headers)
4344
session = requests.Session()
4445
response = session.send( # type: ignore
4546
request=endpoint.prepared_request,
@@ -75,7 +76,7 @@ def test_incorrect(self, endpoint: Endpoint) -> None:
7576
'Date': date,
7677
}
7778

78-
endpoint.prepared_request.headers = headers
79+
endpoint.prepared_request.headers = CaseInsensitiveDict(data=headers)
7980
session = requests.Session()
8081
response = session.send( # type: ignore
8182
request=endpoint.prepared_request,

tests/mock_vws/test_date_header.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import requests
1212
from freezegun import freeze_time
1313
from requests import codes
14+
from requests.structures import CaseInsensitiveDict
1415

1516
from mock_vws._constants import ResultCodes
1617
from tests.mock_vws.utils import Endpoint
@@ -62,7 +63,7 @@ def test_no_date_header(
6263
'Authorization': authorization_string,
6364
}
6465
headers.pop('Date', None)
65-
endpoint.prepared_request.headers = headers
66+
endpoint.prepared_request.headers = CaseInsensitiveDict(data=headers)
6667
session = requests.Session()
6768
response = session.send( # type: ignore
6869
request=endpoint.prepared_request,
@@ -132,7 +133,7 @@ def test_incorrect_date_format(
132133
'Date': date_incorrect_format,
133134
}
134135

135-
endpoint.prepared_request.headers = headers
136+
endpoint.prepared_request.headers = CaseInsensitiveDict(data=headers)
136137
session = requests.Session()
137138
response = session.send( # type: ignore
138139
request=endpoint.prepared_request,
@@ -213,7 +214,7 @@ def test_date_out_of_range(
213214
'Date': date,
214215
}
215216

216-
endpoint.prepared_request.headers = headers
217+
endpoint.prepared_request.headers = CaseInsensitiveDict(data=headers)
217218
session = requests.Session()
218219
response = session.send( # type: ignore
219220
request=endpoint.prepared_request,
@@ -275,7 +276,7 @@ def test_date_in_range(
275276
'Date': date,
276277
}
277278

278-
endpoint.prepared_request.headers = headers
279+
endpoint.prepared_request.headers = CaseInsensitiveDict(data=headers)
279280
session = requests.Session()
280281
response = session.send( # type: ignore
281282
request=endpoint.prepared_request,

tests/mock_vws/test_invalid_json.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import requests
1111
from freezegun import freeze_time
1212
from requests import codes
13+
from requests.structures import CaseInsensitiveDict
1314

1415
from mock_vws._constants import ResultCodes
1516
from tests.mock_vws.utils import Endpoint
@@ -67,7 +68,7 @@ def test_invalid_json(
6768
}
6869

6970
endpoint.prepared_request.body = content
70-
endpoint.prepared_request.headers = headers
71+
endpoint.prepared_request.headers = CaseInsensitiveDict(data=headers)
7172
endpoint.prepared_request.prepare_content_length( # type: ignore
7273
body=content,
7374
)

0 commit comments

Comments
 (0)