mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 02:36:02 +02:00
updates to tests
This commit is contained in:
parent
ff49092b2b
commit
c6abca99ca
1 changed files with 11 additions and 10 deletions
|
@ -791,6 +791,8 @@ class MockEppLib(TestCase):
|
||||||
return self.mockInfoDomainCommands(_request, cleaned)
|
return self.mockInfoDomainCommands(_request, cleaned)
|
||||||
elif isinstance(_request, commands.InfoContact):
|
elif isinstance(_request, commands.InfoContact):
|
||||||
return self.mockInfoContactCommands(_request, cleaned)
|
return self.mockInfoContactCommands(_request, cleaned)
|
||||||
|
elif isinstance(_request, commands.UpdateDomain):
|
||||||
|
return self.mockUpdateDomainCommands(_request, cleaned)
|
||||||
elif (
|
elif (
|
||||||
isinstance(_request, commands.CreateContact)
|
isinstance(_request, commands.CreateContact)
|
||||||
and getattr(_request, "id", None) == "fail"
|
and getattr(_request, "id", None) == "fail"
|
||||||
|
@ -809,16 +811,6 @@ class MockEppLib(TestCase):
|
||||||
res_data=[self.mockDataHostChange],
|
res_data=[self.mockDataHostChange],
|
||||||
code=ErrorCode.COMMAND_COMPLETED_SUCCESSFULLY,
|
code=ErrorCode.COMMAND_COMPLETED_SUCCESSFULLY,
|
||||||
)
|
)
|
||||||
elif (
|
|
||||||
isinstance(_request, commands.UpdateDomain)
|
|
||||||
and getattr(_request, "name", None) == "dnssec-invalid.gov"
|
|
||||||
):
|
|
||||||
raise RegistryError(code=ErrorCode.PARAMETER_VALUE_RANGE_ERROR)
|
|
||||||
elif isinstance(_request, commands.UpdateDomain):
|
|
||||||
return MagicMock(
|
|
||||||
res_data=[self.mockDataHostChange],
|
|
||||||
code=ErrorCode.COMMAND_COMPLETED_SUCCESSFULLY,
|
|
||||||
)
|
|
||||||
elif isinstance(_request, commands.DeleteHost):
|
elif isinstance(_request, commands.DeleteHost):
|
||||||
return MagicMock(
|
return MagicMock(
|
||||||
res_data=[self.mockDataHostChange],
|
res_data=[self.mockDataHostChange],
|
||||||
|
@ -836,6 +828,15 @@ class MockEppLib(TestCase):
|
||||||
)
|
)
|
||||||
return MagicMock(res_data=[self.mockDataInfoHosts])
|
return MagicMock(res_data=[self.mockDataInfoHosts])
|
||||||
|
|
||||||
|
def mockUpdateDomainCommands(self, _request, cleaned):
|
||||||
|
if getattr(_request, "name", None) == "dnssec-invalid.gov":
|
||||||
|
raise RegistryError(code=ErrorCode.PARAMETER_VALUE_RANGE_ERROR)
|
||||||
|
else:
|
||||||
|
return MagicMock(
|
||||||
|
res_data=[self.mockDataHostChange],
|
||||||
|
code=ErrorCode.COMMAND_COMPLETED_SUCCESSFULLY,
|
||||||
|
)
|
||||||
|
|
||||||
def mockInfoDomainCommands(self, _request, cleaned):
|
def mockInfoDomainCommands(self, _request, cleaned):
|
||||||
if getattr(_request, "name", None) == "security.gov":
|
if getattr(_request, "name", None) == "security.gov":
|
||||||
return MagicMock(res_data=[self.infoDomainNoContact])
|
return MagicMock(res_data=[self.infoDomainNoContact])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue