From 43f7659cfe3c0b0295bebf270cb74adfde605f3c Mon Sep 17 00:00:00 2001 From: gruenwaldi Date: Fri, 22 Dec 2023 14:34:08 +0100 Subject: [PATCH] included test for deprecated method message_verify(), to make sure deprecation warning is properly used --- tests/test_ubirch_protocol.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_ubirch_protocol.py b/tests/test_ubirch_protocol.py index d854f43..39a72af 100644 --- a/tests/test_ubirch_protocol.py +++ b/tests/test_ubirch_protocol.py @@ -296,3 +296,11 @@ def _verify(self, uuid: UUID, message: bytes, signature: bytes) -> bytes: self.assertEqual(expectedPubKey, payload[b'pubKeyId']) self.assertEqual( 1574329437, payload[b'validNotAfter']) self.assertEqual( 1542793437, payload[b'validNotBefore']) + + def test_verify_signed_message_deprecated_method(self): + p = Protocol() + unpacked = p.message_verify(bytes(EXPECTED_SIGNED)) + self.assertEqual(SIGNED, unpacked[0]) + self.assertEqual(TEST_UUID.bytes, unpacked[1]) + self.assertEqual(0xEF, unpacked[2]) + self.assertEqual(1, unpacked[3])