How to use the pyisemail.diagnosis.BaseDiagnosis function in pyIsEmail

To help you get started, we’ve selected a few pyIsEmail examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github michaelherold / pyIsEmail / tests / diagnosis / test_base_diagnosis.py View on Github external
def test_lt(self):
        d1 = BaseDiagnosis("test")
        d1.code = 1
        d2 = BaseDiagnosis("test")
        d2.code = 2

        self.assertLess(d1, d2)
        self.assertLess(d1, 3)
github michaelherold / pyIsEmail / tests / diagnosis / test_base_diagnosis.py View on Github external
def test_gt(self):
        d1 = BaseDiagnosis("test")
        d1.code = 1
        d2 = BaseDiagnosis("test")
        d2.code = 2

        self.assertGreater(d2, d1)
        self.assertGreater(3, d1)
github michaelherold / pyIsEmail / tests / diagnosis / test_base_diagnosis.py View on Github external
def test_lt(self):
        d1 = BaseDiagnosis("test")
        d1.code = 1
        d2 = BaseDiagnosis("test")
        d2.code = 2

        self.assertLess(d1, d2)
        self.assertLess(d1, 3)
github michaelherold / pyIsEmail / tests / diagnosis / test_base_diagnosis.py View on Github external
def test_hash(self):
        d1 = BaseDiagnosis("test")
        d2 = BaseDiagnosis("test")

        self.assertEqual(hash(d1), hash(d2))
github michaelherold / pyIsEmail / tests / diagnosis / test_base_diagnosis.py View on Github external
def test_gt(self):
        d1 = BaseDiagnosis("test")
        d1.code = 1
        d2 = BaseDiagnosis("test")
        d2.code = 2

        self.assertGreater(d2, d1)
        self.assertGreater(3, d1)
github michaelherold / pyIsEmail / pyisemail / diagnosis / invalid_diagnosis.py View on Github external
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,
github michaelherold / pyIsEmail / pyisemail / diagnosis / valid_diagnosis.py View on Github external
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