Fix tests

This commit is contained in:
zandercymatics 2023-11-15 11:28:11 -07:00
parent 13ef2a88e0
commit 6f31e02f2b
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -125,10 +125,14 @@ class TestConnectionPool(TestCase):
xml = (location).read_bytes()
return xml
def do_nothing(command):
pass
# Mock what happens inside the "with"
with ExitStack() as stack:
stack.enter_context(patch.object(EPPConnectionPool, "_create_socket", self.fake_socket))
stack.enter_context(patch.object(Socket, "connect", self.fake_client))
stack.enter_context(patch.object(EPPConnectionPool, "kill_all_connections", do_nothing))
stack.enter_context(patch.object(SocketTransport, "send", self.fake_send))
stack.enter_context(patch.object(SocketTransport, "receive", fake_receive))
# Restart the connection pool