mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-12 14:08:28 +02:00
Test fix for scanner
This commit is contained in:
parent
9c6a6ef12a
commit
ffcfb9818b
2 changed files with 18 additions and 11 deletions
|
@ -72,7 +72,6 @@ class TestConnectionPool(TestCase):
|
||||||
@patch.object(EPPLibWrapper, "_test_registry_connection_success", patch_success)
|
@patch.object(EPPLibWrapper, "_test_registry_connection_success", patch_success)
|
||||||
def test_pool_sends_data(self):
|
def test_pool_sends_data(self):
|
||||||
"""A .send is invoked on the pool successfully"""
|
"""A .send is invoked on the pool successfully"""
|
||||||
self.maxDiff = None
|
|
||||||
expected_result = {
|
expected_result = {
|
||||||
'cl_tr_id': None,
|
'cl_tr_id': None,
|
||||||
'code': 1000,
|
'code': 1000,
|
||||||
|
@ -124,6 +123,7 @@ class TestConnectionPool(TestCase):
|
||||||
location= Path(__file__).parent / "utility" / "infoDomain.xml"
|
location= Path(__file__).parent / "utility" / "infoDomain.xml"
|
||||||
xml = (location).read_bytes()
|
xml = (location).read_bytes()
|
||||||
return xml
|
return xml
|
||||||
|
|
||||||
# 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))
|
||||||
|
@ -139,7 +139,11 @@ class TestConnectionPool(TestCase):
|
||||||
# Send a command
|
# Send a command
|
||||||
result = registry.send(commands.InfoDomain(name="test.gov"), cleaned=True)
|
result = registry.send(commands.InfoDomain(name="test.gov"), cleaned=True)
|
||||||
|
|
||||||
|
# Should this ever fail, it either means that the schema has changed,
|
||||||
|
# or the pool is broken.
|
||||||
|
# If the schema has changed: Update the associated infoDomain.xml file
|
||||||
self.assertEqual(result.__dict__, expected_result)
|
self.assertEqual(result.__dict__, expected_result)
|
||||||
|
|
||||||
# The number of open pools should match the number of requested ones.
|
# The number of open pools should match the number of requested ones.
|
||||||
# If it is 0, then they failed to open
|
# If it is 0, then they failed to open
|
||||||
self.assertEqual(len(registry._pool.conn), self.pool_options["size"])
|
self.assertEqual(len(registry._pool.conn), self.pool_options["size"])
|
||||||
|
|
|
@ -17,6 +17,7 @@ from registrar.utility.errors import (
|
||||||
NameserverErrorCodes as nsErrorCodes,
|
NameserverErrorCodes as nsErrorCodes,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
from epplibwrapper import (
|
from epplibwrapper import (
|
||||||
CLIENT as registry,
|
CLIENT as registry,
|
||||||
commands,
|
commands,
|
||||||
|
@ -26,6 +27,8 @@ from epplibwrapper import (
|
||||||
RegistryError,
|
RegistryError,
|
||||||
ErrorCode,
|
ErrorCode,
|
||||||
)
|
)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
from registrar.models.utility.contact_error import ContactError, ContactErrorCodes
|
from registrar.models.utility.contact_error import ContactError, ContactErrorCodes
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue