Skip to content

Commit

Permalink
Fixed some ci failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jessesightler-redhat committed Jun 28, 2024
1 parent aac0b17 commit 9706f11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion kazoo/handlers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ def create_tcp_connection(
addrs = socket.getaddrinfo(
address[0], address[1], 0, socket.SOCK_STREAM
)
conn = context.wrap_socket(module.socket(addrs[0][0]), server_hostname=hostname)
conn = context.wrap_socket(
module.socket(addrs[0][0]), server_hostname=hostname
)
conn.settimeout(timeout_at)
conn.connect(address)
sock = conn
Expand Down
10 changes: 7 additions & 3 deletions kazoo/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ def test_timeout_arg(self):

def test_ssl_server_hostname(self):
from kazoo.handlers import utils
from kazoo.handlers.utils import create_tcp_connection, socket, ssl
from kazoo.handlers.utils import create_tcp_connection, ssl

with patch.object(utils, "_set_default_tcpsock_options"):
with patch.object(ssl.SSLContext, "wrap_socket") as wrap_socket:
create_tcp_connection(
socket, ("127.0.0.1", 2181), timeout=1.5, hostname="fakehostname", use_ssl=True
socket,
("127.0.0.1", 2181),
timeout=1.5,
hostname="fakehostname",
use_ssl=True
)

for call_args in wrap_socket.call_args_list:
Expand All @@ -49,7 +53,7 @@ def test_timeout_arg_eventlet(self):
pytest.skip("eventlet handler not available.")

from kazoo.handlers import utils
from kazoo.handlers.utils import create_tcp_connection, socket, time
from kazoo.handlers.utils import create_tcp_connection, time

with patch.object(socket, "create_connection") as create_connection:
with patch.object(utils, "_set_default_tcpsock_options"):
Expand Down

0 comments on commit 9706f11

Please sign in to comment.