5
Copyright (c) 1999 Ng Pheng Siong. All rights reserved."""
8
from M2Crypto import EVP, PGP
9
from cStringIO import StringIO
12
class PGPTestCase(unittest.TestCase):
14
def test_simple(self):
15
pkr = PGP.load_pubring('tests/pubring.pgp')
17
daft_pkt = daft._pubkey_pkt.pack()
18
s1 = EVP.MessageDigest('sha1')
22
buf = StringIO(daft_pkt)
23
ps = PGP.packet_stream(buf)
25
s2 = EVP.MessageDigest('sha1')
26
s2.update(dift_pkt.pack())
29
self.assertEqual(s1f, s2f)
32
suite = unittest.TestSuite()
33
suite.addTest(unittest.makeSuite(PGPTestCase))
37
if __name__ == '__main__':
38
Rand.load_file('randpool.dat', -1)
39
unittest.TextTestRunner().run(suite())
40
Rand.save_file('randpool.dat')