def test_getExtraInfoDigests(self): sha1hash = hashlib.sha1() test = "Many words and line all together\n" test += "extra info is nothing like weather\n" test += "it's certain to come, like the key in a hum\n" test += "but sometimes without a transport and rum\n" content = test sha1hash.update(test) digest = sha1hash.hexdigest() test += "-----BEGIN SIGNATURE-----\n" test += "But the rum can't save the world like you\n" test += "-----END SIGNATURE-----\n" digests = Bridges.getExtraInfoDigests(StringIO(test)) self.failUnlessIn(digest, digests) self.failUnlessEqual(content, digests[digest].read())