Example #1
0
    def test_equality(self):
        a = EncryptedPassportElement(self.type_, data=self.data)
        b = EncryptedPassportElement(self.type_, data=self.data)
        c = EncryptedPassportElement(self.data, '')
        d = PassportElementError('source', 'type', '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)
    def test_equality(self):
        a = EncryptedPassportElement(self.type_, self.hash, data=self.data)
        b = EncryptedPassportElement(self.type_, self.hash, data=self.data)
        c = EncryptedPassportElement(self.data, "")
        d = PassportElementError("source", "type", "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)
Example #3
0
    def test_equality(self):
        a = PassportFile(self.file_id, self.file_unique_id, self.file_size, self.file_date)
        b = PassportFile("", self.file_unique_id, self.file_size, self.file_date)
        c = PassportFile(self.file_id, self.file_unique_id, "", "")
        d = PassportFile("", "", self.file_size, self.file_date)
        e = PassportElementError("source", "type", "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)
    def test_equality(self):
        a = PassportFile(self.file_id, self.file_unique_id, self.file_size, self.file_date)
        b = PassportFile('', self.file_unique_id, self.file_size, self.file_date)
        c = PassportFile(self.file_id, self.file_unique_id, '', '')
        d = PassportFile('', '', self.file_size, self.file_date)
        e = PassportElementError('source', 'type', '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)
    def test_equality(self):
        a = EncryptedCredentials(self.data, self.hash, self.secret)
        b = EncryptedCredentials(self.data, self.hash, self.secret)
        c = EncryptedCredentials(self.data, '', '')
        d = EncryptedCredentials('', self.hash, '')
        e = EncryptedCredentials('', '', self.secret)
        f = PassportElementError('source', 'type', '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)
Example #6
0
    def test_equality(self):
        a = EncryptedCredentials(self.data, self.hash, self.secret)
        b = EncryptedCredentials(self.data, self.hash, self.secret)
        c = EncryptedCredentials(self.data, "", "")
        d = EncryptedCredentials("", self.hash, "")
        e = EncryptedCredentials("", "", self.secret)
        f = PassportElementError("source", "type", "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)