File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import time
33
44import pytest
5+ from aiosonic import HttpHeaders
56
67from datadog_api_client .api_client import AsyncApiClient
78from datadog_api_client .configuration import Configuration
@@ -21,7 +22,9 @@ async def test_error():
2122 error = str (e .value )
2223 assert "(403)" in error
2324 assert "Reason: Forbidden" in error
24- assert e .value .headers ["Content-Type" ] == "application/json"
25+ # cast headers to HttpHeaders to make them case insensitive
26+ headers = HttpHeaders (e .value .headers )
27+ assert headers ["content-type" ] == "application/json"
2528 assert e .value .body ["errors" ] == ["Forbidden" ]
2629
2730
@@ -41,7 +44,8 @@ async def test_basic():
4144 api_instance = dashboards_api .DashboardsApi (api_client )
4245 _ , code , headers = await api_instance .list_dashboards ()
4346 assert code == 200
44- assert headers ["Content-Type" ] == "application/json"
47+ headers = HttpHeaders (headers )
48+ assert headers ["content-type" ] == "application/json"
4549
4650
4751@pytest .mark .asyncio
Original file line number Diff line number Diff line change 11import os
22
33import pytest
4+ from aiosonic import HttpHeaders
45
56from datadog_api_client .api_client import ThreadedApiClient
67from datadog_api_client .configuration import Configuration
@@ -23,4 +24,6 @@ def test_basic():
2324 thread = api_instance .list_dashboards ()
2425 _ , code , headers = thread .get ()
2526 assert code == 200
26- assert headers ["Content-Type" ] == "application/json"
27+ # cast headers to HttpHeaders to make them case insensitive
28+ headers = HttpHeaders (headers )
29+ assert headers ["content-type" ] == "application/json"
You can’t perform that action at this time.
0 commit comments