File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 2
2
import time
3
3
4
4
import pytest
5
+ from aiosonic import HttpHeaders
5
6
6
7
from datadog_api_client .api_client import AsyncApiClient
7
8
from datadog_api_client .configuration import Configuration
@@ -21,7 +22,9 @@ async def test_error():
21
22
error = str (e .value )
22
23
assert "(403)" in error
23
24
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"
25
28
assert e .value .body ["errors" ] == ["Forbidden" ]
26
29
27
30
@@ -41,7 +44,8 @@ async def test_basic():
41
44
api_instance = dashboards_api .DashboardsApi (api_client )
42
45
_ , code , headers = await api_instance .list_dashboards ()
43
46
assert code == 200
44
- assert headers ["Content-Type" ] == "application/json"
47
+ headers = HttpHeaders (headers )
48
+ assert headers ["content-type" ] == "application/json"
45
49
46
50
47
51
@pytest .mark .asyncio
Original file line number Diff line number Diff line change 1
1
import os
2
2
3
3
import pytest
4
+ from aiosonic import HttpHeaders
4
5
5
6
from datadog_api_client .api_client import ThreadedApiClient
6
7
from datadog_api_client .configuration import Configuration
@@ -23,4 +24,6 @@ def test_basic():
23
24
thread = api_instance .list_dashboards ()
24
25
_ , code , headers = thread .get ()
25
26
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