Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_lt(self):
d1 = BaseDiagnosis("test")
d1.code = 1
d2 = BaseDiagnosis("test")
d2.code = 2
self.assertLess(d1, d2)
self.assertLess(d1, 3)
def test_gt(self):
d1 = BaseDiagnosis("test")
d1.code = 1
d2 = BaseDiagnosis("test")
d2.code = 2
self.assertGreater(d2, d1)
self.assertGreater(3, d1)
def test_lt(self):
d1 = BaseDiagnosis("test")
d1.code = 1
d2 = BaseDiagnosis("test")
d2.code = 2
self.assertLess(d1, d2)
self.assertLess(d1, 3)
def test_hash(self):
d1 = BaseDiagnosis("test")
d2 = BaseDiagnosis("test")
self.assertEqual(hash(d1), hash(d2))
def test_gt(self):
d1 = BaseDiagnosis("test")
d1.code = 1
d2 = BaseDiagnosis("test")
d2.code = 2
self.assertGreater(d2, d1)
self.assertGreater(3, d1)
from pyisemail.diagnosis import BaseDiagnosis
class InvalidDiagnosis(BaseDiagnosis):
"""A diagnosis indicating the presence of an invalid address component.
"""
DESCRIPTION = "Address is invalid for any purpose"
ERROR_CODES = {
'EXPECTING_DTEXT': 129,
'NOLOCALPART': 130,
'NODOMAIN': 131,
'CONSECUTIVEDOTS': 132,
'ATEXT_AFTER_CFWS': 133,
'ATEXT_AFTER_QS': 134,
'ATEXT_AFTER_DOMLIT': 135,
'EXPECTING_QPAIR': 136,
from pyisemail.diagnosis import BaseDiagnosis
class ValidDiagnosis(BaseDiagnosis):
"""A diagnosis indicating the address is valid for use.
"""
DESCRIPTION = "Address is valid."
MESSAGE = ("Address is valid. Please note that this does not mean "
"the address actually exists, nor even that the domain "
"actually exists. This address could be issued by the "
"domain owner without breaking the rules of any RFCs.")
def __init__(self, diagnosis_type='VALID'):
self.diagnosis_type = diagnosis_type
self.description = self.DESCRIPTION
self.message = self.MESSAGE