mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 12:38:36 +02:00
Remove extraneous print statements and rename extendedValues to threeNS
This commit is contained in:
parent
5fcae0cb80
commit
fbad2abd9d
3 changed files with 9 additions and 10 deletions
|
@ -277,14 +277,12 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
return self.name in nameserver
|
||||
|
||||
def checkHostIPCombo(self, nameserver: str, ip: list):
|
||||
print("Do I come into checkHostIPCombo")
|
||||
if self.isSubdomain(nameserver) and (ip is None or ip == []):
|
||||
raise ValueError(
|
||||
"Nameserver %s needs to have an "
|
||||
"IP address because it is a subdomain" % nameserver
|
||||
)
|
||||
elif not self.isSubdomain(nameserver) and (ip is not None and ip != []):
|
||||
print("In 2nd else statement")
|
||||
raise ValueError(
|
||||
"Nameserver %s cannot be linked "
|
||||
"because %s is not a subdomain" % (nameserver, ip)
|
||||
|
|
|
@ -644,14 +644,15 @@ class MockEppLib(TestCase):
|
|||
],
|
||||
)
|
||||
|
||||
# TODO-848: Fix naming
|
||||
extendedValues = False
|
||||
# Bc we have multiple tests utilizing 3 nameservers,
|
||||
# easier to set a flag for it
|
||||
threeNS = False
|
||||
|
||||
def _getattrInfoDomain(self, _request):
|
||||
if getattr(_request, "name", None) == "security.gov":
|
||||
return MagicMock(res_data=[self.infoDomainNoContact])
|
||||
elif getattr(_request, "name", None) == "my-nameserver.gov":
|
||||
if self.extendedValues:
|
||||
if self.threeNS:
|
||||
return MagicMock(res_data=[self.infoDomainThreeHosts])
|
||||
elif self.mockedSendFunction.call_count == 5:
|
||||
return MagicMock(res_data=[self.infoDomainTwoHosts])
|
||||
|
|
|
@ -859,7 +859,7 @@ class TestRegistrantNameservers(MockEppLib):
|
|||
"""
|
||||
|
||||
# Mock is set to return 3 nameservers on infodomain
|
||||
self.extendedValues = True
|
||||
self.threeNS = True
|
||||
self.domain.nameservers = [(self.nameserver1,), (self.nameserver2,)]
|
||||
expectedCalls = [
|
||||
# calls info domain, and info on all hosts
|
||||
|
@ -900,7 +900,7 @@ class TestRegistrantNameservers(MockEppLib):
|
|||
And `domain.is_active` returns False
|
||||
|
||||
"""
|
||||
self.extendedValues = True
|
||||
self.threeNS = True
|
||||
self.domain.ready()
|
||||
self.domain.nameservers = [(self.nameserver1,)]
|
||||
expectedCalls = [
|
||||
|
@ -952,7 +952,7 @@ class TestRegistrantNameservers(MockEppLib):
|
|||
And `commands.UpdateDomain` is sent to add #4 and #5 plus remove #2 and #3
|
||||
And `commands.DeleteHost` is sent to delete #2 and #3
|
||||
"""
|
||||
self.extendedValues = True
|
||||
self.threeNS = True
|
||||
self.domain.ready()
|
||||
self.domain.nameservers = [
|
||||
(self.nameserver1,),
|
||||
|
@ -1112,7 +1112,7 @@ class TestRegistrantNameservers(MockEppLib):
|
|||
# sent like this, and then implementing appropriate mocks for any errors the
|
||||
# registry normally sends in this case
|
||||
|
||||
self.extendedValues = True
|
||||
self.threeNS = True
|
||||
|
||||
# Checking that it doesn't create or update even if out of order
|
||||
self.domain.nameservers = [
|
||||
|
@ -1194,7 +1194,7 @@ class TestRegistrantNameservers(MockEppLib):
|
|||
# print(self.mockedSendFunction.call_args_list)
|
||||
|
||||
def tearDown(self):
|
||||
self.extendedValues = False
|
||||
self.threeNS = False
|
||||
return super().tearDown()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue