def test_equality(self):
        a = PassportElementErrorUnspecified(self.type, self.element_hash,
                                            self.message)
        b = PassportElementErrorUnspecified(self.type, self.element_hash,
                                            self.message)
        c = PassportElementErrorUnspecified(self.type, '', '')
        d = PassportElementErrorUnspecified('', self.element_hash, '')
        e = PassportElementErrorUnspecified('', '', self.message)
        f = PassportElementErrorDataField(self.type, '', '', self.message)

        assert a == b
        assert hash(a) == hash(b)
        assert a is not b

        assert a != c
        assert hash(a) != hash(c)

        assert a != d
        assert hash(a) != hash(d)

        assert a != e
        assert hash(a) != hash(e)

        assert a != f
        assert hash(a) != hash(f)
Exemplo n.º 2
0
def passport_element_error_unspecified():
    return PassportElementErrorUnspecified(
        TestPassportElementErrorUnspecified.type_,
        TestPassportElementErrorUnspecified.element_hash,
        TestPassportElementErrorUnspecified.message,
    )