def test_get_all_public_key_data(self): # Hm. The behaviour of something that matches # more than one key may change. data = get_public_key_data("", homedir=self.homedir) newkey = openpgpkey_from_data(data) # Hrm. We may be better off checking for a few things # we actually care about rather than delegating to the Key() itself. assert_equals(self.originalkey, newkey)
def test_no_match(self): data = get_public_key_data("nothing should match this", homedir=self.homedir) newkey = openpgpkey_from_data(data) assert False
def test_get_public_key_data(self): fpr = self.originalkey.fingerprint data = get_public_key_data(fpr, homedir=self.homedir) newkey = openpgpkey_from_data(data) assert_equals(fpr, newkey.fingerprint)
def test_get_public_key_no_data(): tmp = tempfile.mkdtemp() d = get_public_key_data(None, homedir=tmp) assert_equals("", d)