Skip to content

Commit

Permalink
Use real TLS context where it's disabled in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Jan 5, 2019
1 parent 13f4b52 commit 432c4c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions tests/test_client_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,11 @@ async def handler(request):
assert 200 == resp.status


async def test_ssl_client(ssl_ctx, aiohttp_server, aiohttp_client) -> None:
connector = aiohttp.TCPConnector(ssl=False)
async def test_ssl_client(
aiohttp_server, ssl_ctx,
aiohttp_client, client_ssl_ctx,
) -> None:
connector = aiohttp.TCPConnector(ssl=client_ssl_ctx)

async def handler(request):
return web.Response(text='Test message')
Expand Down
4 changes: 2 additions & 2 deletions tests/test_client_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -1270,11 +1270,11 @@ async def create_connection(req, traces, timeout):
conn.close()


def test_verify_ssl_false_with_ssl_context(loop) -> None:
def test_verify_ssl_false_with_ssl_context(loop, ssl_ctx) -> None:
with pytest.warns(DeprecationWarning):
with pytest.raises(ValueError):
_merge_ssl_params(None, verify_ssl=False,
ssl_context=mock.Mock(), fingerprint=None)
ssl_context=ssl_ctx, fingerprint=None)


def test_bad_fingerprint(loop) -> None:
Expand Down

0 comments on commit 432c4c5

Please sign in to comment.