Example #1
0
 def test_good_linked_message_validates(self):
     msg1 = Message("first").seal()
     msg2 = Message("second").link(msg1).seal()
     msg2.validate()  # no exceptions raised
     # sanity check the hashes
     self.assertEqual(self.payload_hash(msg2), msg2.payload_hash)
     self.assertEqual(self.message_hash(msg2), msg2.hash)
Example #2
0
 def test_good_linked_message_validates(self):
     msg1 = Message("first").seal()
     msg2 = Message("second").link(msg1).seal()
     msg2.validate()  # no exceptions raised
     # sanity check the hashes
     self.assertEqual(self.payload_hash(msg2), msg2.payload_hash)
     self.assertEqual(self.message_hash(msg2), msg2.hash)
Example #3
0
 def test_good_unlinked_message_validates(self):
     msg = Message("some data", "Alice", "Bob").seal()
     msg.validate()  # no exceptions raised
     # sanity check the hashes
     self.assertEqual(self.payload_hash(msg), msg.payload_hash)
     self.assertEqual(self.message_hash(msg), msg.hash)
Example #4
0
 def test_good_unlinked_message_validates(self):
     msg = Message("some data", "Alice", "Bob").seal()
     msg.validate()  # no exceptions raised
     # sanity check the hashes
     self.assertEqual(self.payload_hash(msg), msg.payload_hash)
     self.assertEqual(self.message_hash(msg), msg.hash)