Skip to content

Commit

Permalink
Release 1.0.9 (#31)
Browse files Browse the repository at this point in the history
* Formatting
* Update setup.py fix RST on pypi
  • Loading branch information
jacobschaer authored Jul 4, 2023
1 parent 364b200 commit c479ade
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

setuptools.setup(
name="doipclient",
version="1.0.8",
version="1.0.9",
description="A Diagnostic over IP (DoIP) client implementing ISO-13400-2.",
long_description=long_description,
long_description_content_type='text/x-rst',
author="Jacob Schaer",
url="https://github.com/jacobschaer/python-doipclient",
packages=setuptools.find_packages(),
Expand Down
14 changes: 9 additions & 5 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,10 @@ def test_await_ipv4(mock_socket):


def test_exception_from_blocking_ssl_socket(mock_socket, mocker):
"""SSL sockets behave slightly different than regular sockets in
non-blocking mode. They won't raise BlockingIOError but SSLWantWriteError
"""SSL sockets behave slightly different than regular sockets in
non-blocking mode. They won't raise BlockingIOError but SSLWantWriteError
or SSLWantReadError instead.
See: https://docs.python.org/3/library/ssl.html#notes-on-non-blocking-sockets
"""
sut = DoIPClient(test_ip, test_logical_address)
Expand All @@ -664,13 +664,17 @@ def test_exception_from_blocking_ssl_socket(mock_socket, mocker):
def test_use_secure_uses_default_ssl_context(mock_socket, mocker):
"""Wrap socket with default SSL-context when use_secure=True"""
mocked_context = mocker.patch.object(ssl, "SSLContext", autospec=True)
sut = DoIPClient(test_ip, test_logical_address, use_secure=True, activation_type=None)
sut = DoIPClient(
test_ip, test_logical_address, use_secure=True, activation_type=None
)
mocked_wrap_socket = mocked_context.return_value.wrap_socket
mocked_wrap_socket.assert_called_once_with(mock_socket)


def test_use_secure_with_external_ssl_context(mock_socket, mocker):
"""Wrap socket with user provided SSL-context when use_secure=ssl_context"""
mocked_context = mocker.patch.object(ssl, "SSLContext", autospec=True)
sut = DoIPClient(test_ip, test_logical_address, use_secure=mocked_context, activation_type=None)
sut = DoIPClient(
test_ip, test_logical_address, use_secure=mocked_context, activation_type=None
)
mocked_context.wrap_socket.assert_called_once_with(mock_socket)

0 comments on commit c479ade

Please sign in to comment.