Explicitly set the passphrase on one of the unittest keys.
parent
3780a6bed2
commit
ba37ce083d
|
@ -658,11 +658,12 @@ class GPGTestCase(unittest.TestCase):
|
||||||
log.debug("test_deletion ends")
|
log.debug("test_deletion ends")
|
||||||
|
|
||||||
def test_encryption(self):
|
def test_encryption(self):
|
||||||
"""Test encryption of a message string."""
|
"""Test encryption of a message string"""
|
||||||
key = self.generate_key("Craig Gentry", "xorr.ox",
|
key = self.generate_key("Craig Gentry", "xorr.ox",
|
||||||
passphrase="craiggentry")
|
passphrase="craiggentry")
|
||||||
gentry = key.fingerprint
|
gentry = key.fingerprint
|
||||||
key = self.generate_key("Marten van Dijk", "xorr.ox")
|
key = self.generate_key("Marten van Dijk", "xorr.ox",
|
||||||
|
passphrase="martenvandijk")
|
||||||
dijk = key.fingerprint
|
dijk = key.fingerprint
|
||||||
gpg = self.gpg
|
gpg = self.gpg
|
||||||
message = """
|
message = """
|
||||||
|
@ -672,8 +673,10 @@ transparent multi-hop wireless backhauls that are able to perform statistical
|
||||||
analysis of different kinds of data (temperature, humidity, etc.) coming from
|
analysis of different kinds of data (temperature, humidity, etc.) coming from
|
||||||
a WSN while ensuring both end-to-end encryption and hop-by-hop
|
a WSN while ensuring both end-to-end encryption and hop-by-hop
|
||||||
authentication."""
|
authentication."""
|
||||||
encrypted = str(gpg.encrypt(message, dijk))
|
encrypted = str(gpg.encrypt(message, [dijk], ))
|
||||||
self.assertNotEqual(message, encrypted, "Data must have changed")
|
self.assertNotEqual(message, encrypted)
|
||||||
|
self.assertNotEqual(encrypted, '')
|
||||||
|
self.assertGreater(len(encrypted), 0)
|
||||||
|
|
||||||
def test_encryption_alt_encoding(self):
|
def test_encryption_alt_encoding(self):
|
||||||
"""Test encryption with latin-1 encoding"""
|
"""Test encryption with latin-1 encoding"""
|
||||||
|
|
Loading…
Reference in New Issue