diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-20 06:32:29 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-20 06:32:29 (GMT) |
commit | bd617adf6b65e50380a8a4a1c9a1b40c4ea6547b (patch) | |
tree | e04c570efa5d2d2a521781dff34be6bb6c11cb19 /Lib/test/test_binascii.py | |
parent | 9aa16d93c9570771bdb8f0819e4b17f4284c952e (diff) | |
download | cpython-bd617adf6b65e50380a8a4a1c9a1b40c4ea6547b.zip cpython-bd617adf6b65e50380a8a4a1c9a1b40c4ea6547b.tar.gz cpython-bd617adf6b65e50380a8a4a1c9a1b40c4ea6547b.tar.bz2 |
Issue #23728: Added a test for binascii.crc_hqx().
Diffstat (limited to 'Lib/test/test_binascii.py')
-rw-r--r-- | Lib/test/test_binascii.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_binascii.py b/Lib/test/test_binascii.py index f825f1c..d40b672 100644 --- a/Lib/test/test_binascii.py +++ b/Lib/test/test_binascii.py @@ -137,6 +137,14 @@ class BinASCIITest(unittest.TestCase): # Issue #7701 (crash on a pydebug build) self.assertEqual(binascii.b2a_uu('x'), '!> \n') + def test_crc_hqx(self): + crc = binascii.crc_hqx(self.type2test(b"Test the CRC-32 of"), 0) + crc = binascii.crc_hqx(self.type2test(b" this string."), crc) + self.assertEqual(crc, 14290) + + self.assertRaises(TypeError, binascii.crc_hqx) + self.assertRaises(TypeError, binascii.crc_hqx, self.type2test(b'')) + def test_crc32(self): crc = binascii.crc32(self.type2test("Test the CRC-32 of")) crc = binascii.crc32(self.type2test(" this string."), crc) |