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