def test_invalid_not_enough_trust(self): key = utilities.make_key() key.uids[0] = utilities.make_uid( mock.sentinel.EMAIL, validity=gpg.constants.validity.UNDEFINED) ret = crypto.check_uid_validity(key, mock.sentinel.EMAIL) self.assertFalse(ret)
def test_valid_multiple(self): key = utilities.make_key() key.uids = [ utilities.make_uid(mock.sentinel.EMAIL), utilities.make_uid(mock.sentinel.EMAIL1), ] ret = crypto.check_uid_validity(key, mock.sentinel.EMAIL1) self.assertTrue(ret)
def test_valid_multiple(self): key = utilities.make_key() key.uids = [ utilities.make_uid(mock.sentinel.EMAIL), utilities.make_uid(mock.sentinel.EMAIL1), ] ret = crypto.check_uid_validity(key, mock.sentinel.EMAIL1) self.assertTrue(ret)
def test_invalid_invalid(self): key = utilities.make_key() key.uids[0] = utilities.make_uid(mock.sentinel.EMAIL, invalid=True) ret = crypto.check_uid_validity(key, mock.sentinel.EMAIL) self.assertFalse(ret)
def test_valid_single(self): key = utilities.make_key() key.uids[0] = utilities.make_uid(mock.sentinel.EMAIL) ret = crypto.check_uid_validity(key, mock.sentinel.EMAIL) self.assertTrue(ret)
def test_invalid_not_enough_trust(self): key = utilities.make_key() key.uids[0] = utilities.make_uid( mock.sentinel.EMAIL, validity=gpg.constants.validity.UNDEFINED) ret = crypto.check_uid_validity(key, mock.sentinel.EMAIL) self.assertFalse(ret)
def test_invalid_invalid(self): key = utilities.make_key() key.uids[0] = utilities.make_uid(mock.sentinel.EMAIL, invalid=True) ret = crypto.check_uid_validity(key, mock.sentinel.EMAIL) self.assertFalse(ret)
def test_valid_single(self): key = utilities.make_key() key.uids[0] = utilities.make_uid(mock.sentinel.EMAIL) ret = crypto.check_uid_validity(key, mock.sentinel.EMAIL) self.assertTrue(ret)