Example #1
0
 def test_trash(self, _document):
     _document.return_value = Document()
     message = 123
     document, original, signature = peal(message)
     self.assertEqual(document, _document.return_value)
     self.assertEqual(original, message)
     self.assertEqual(signature, None)
Example #2
0
 def test_trash(self, _document):
     _document.return_value = Document()
     message = 123
     document, original, signature = peal(message)
     self.assertEqual(document, _document.return_value)
     self.assertEqual(original, message)
     self.assertEqual(signature, None)
Example #3
0
 def test_unsigned(self):
     message = '{"A":1}'
     document, original, signature = peal(message)
     self.assertEqual(document['A'], 1)
     self.assertEqual(original, message)
     self.assertEqual(signature, None)
Example #4
0
 def test_signed(self):
     message = '{"message": "{\\"A\\":1}", "signature": "test-signature"}'
     document, original, signature = peal(message)
     self.assertEqual(document['A'], 1)
     self.assertEqual(original, '{"A":1}')
     self.assertEqual(signature, 'test-signature')
Example #5
0
 def test_unsigned(self):
     message = '{"A":1}'
     document, original, signature = peal(message)
     self.assertEqual(document['A'], 1)
     self.assertEqual(original, '{"A":1}')
     self.assertEqual(signature, None)
Example #6
0
 def test_signed(self):
     message = '{"message": "{\\"A\\":1}", "signature": "test-signature"}'
     document, original, signature = peal(message)
     self.assertEqual(document['A'], 1)
     self.assertEqual(original, '{"A":1}')
     self.assertEqual(signature, 'test-signature')