mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 04:28:39 +02:00
Fix tests
This commit is contained in:
parent
13ef2a88e0
commit
6f31e02f2b
1 changed files with 4 additions and 0 deletions
|
@ -125,10 +125,14 @@ class TestConnectionPool(TestCase):
|
||||||
xml = (location).read_bytes()
|
xml = (location).read_bytes()
|
||||||
return xml
|
return xml
|
||||||
|
|
||||||
|
def do_nothing(command):
|
||||||
|
pass
|
||||||
|
|
||||||
# Mock what happens inside the "with"
|
# Mock what happens inside the "with"
|
||||||
with ExitStack() as stack:
|
with ExitStack() as stack:
|
||||||
stack.enter_context(patch.object(EPPConnectionPool, "_create_socket", self.fake_socket))
|
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(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, "send", self.fake_send))
|
||||||
stack.enter_context(patch.object(SocketTransport, "receive", fake_receive))
|
stack.enter_context(patch.object(SocketTransport, "receive", fake_receive))
|
||||||
# Restart the connection pool
|
# Restart the connection pool
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue