From 4b135fc75fc3ed294a1744e0fb2c92c5f7fa24d3 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Sat, 28 Sep 2024 09:13:02 -0500 Subject: [PATCH] Feedback: Add testing of GUID conversions --- test/test_guid.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/test_guid.py diff --git a/test/test_guid.py b/test/test_guid.py new file mode 100644 index 00000000..aba8e2a1 --- /dev/null +++ b/test/test_guid.py @@ -0,0 +1,13 @@ +from smartcard.guid import GUIDToStr, strToGUID + + +def test_roundtrip_string(): + string = '{AD4F1667-EA75-4124-84D4-641B3B197C65}' + assert GUIDToStr(strToGUID(string)) == string + + +def test_roundtrip_list_of_ints(): + list_of_ints = [ + 103, 22, 79, 173, 117, 234, 36, 65, 132, 212, 100, 27, 59, 25, 124, 101 + ] + assert strToGUID(GUIDToStr(list_of_ints)) == list_of_ints