1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Fix aiohttp deprecation warnings (#13240)

* Fix aiohttp deprecation warnings

* Fix Ring deprecation warning

* Lint
This commit is contained in:
Paulus Schoutsen
2018-03-15 13:49:49 -07:00
committed by Pascal Vizeli
parent a86bf81768
commit 89a19c89a7
45 changed files with 221 additions and 225 deletions

View File

@@ -11,13 +11,13 @@ async def mock_handler(request):
return web.Response(text=str(request[KEY_REAL_IP]))
async def test_ignore_x_forwarded_for(test_client):
async def test_ignore_x_forwarded_for(aiohttp_client):
"""Test that we get the IP from the transport."""
app = web.Application()
app.router.add_get('/', mock_handler)
setup_real_ip(app, False)
mock_api_client = await test_client(app)
mock_api_client = await aiohttp_client(app)
resp = await mock_api_client.get('/', headers={
X_FORWARDED_FOR: '255.255.255.255'
@@ -27,13 +27,13 @@ async def test_ignore_x_forwarded_for(test_client):
assert text != '255.255.255.255'
async def test_use_x_forwarded_for(test_client):
async def test_use_x_forwarded_for(aiohttp_client):
"""Test that we get the IP from the transport."""
app = web.Application()
app.router.add_get('/', mock_handler)
setup_real_ip(app, True)
mock_api_client = await test_client(app)
mock_api_client = await aiohttp_client(app)
resp = await mock_api_client.get('/', headers={
X_FORWARDED_FOR: '255.255.255.255'