diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-10-24 20:35:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-24 20:35:22 (GMT) |
commit | 04c0a4038e8764f742de8505600b8ee97ee50776 (patch) | |
tree | bc647fc9351b5237bae5de33c525d9f89387b305 | |
parent | ef346a2473376c888ff160db9623eaa9871db2ac (diff) | |
download | cpython-04c0a4038e8764f742de8505600b8ee97ee50776.zip cpython-04c0a4038e8764f742de8505600b8ee97ee50776.tar.gz cpython-04c0a4038e8764f742de8505600b8ee97ee50776.tar.bz2 |
[2.7] bpo-25287: Backport new tests for crypt and skip test_crypt on OpenBSD. (GH-4111). (#4112)
(cherry picked from commit f52dff611cff2fb9e90340b4787eda50ab2d40c6)
-rw-r--r-- | Lib/test/test_crypt.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Lib/test/test_crypt.py b/Lib/test/test_crypt.py index 4db200d..7cd9c71 100644 --- a/Lib/test/test_crypt.py +++ b/Lib/test/test_crypt.py @@ -1,14 +1,20 @@ +import sys from test import test_support import unittest crypt = test_support.import_module('crypt') +if sys.platform.startswith('openbsd'): + raise unittest.SkipTest('The only supported method on OpenBSD is Blowfish') + class CryptTestCase(unittest.TestCase): def test_crypt(self): - c = crypt.crypt('mypassword', 'ab') - if test_support.verbose: - print 'Test encryption: ', c + cr = crypt.crypt('mypassword', 'ab') + if cr is not None: + cr2 = crypt.crypt('mypassword', cr) + self.assertEqual(cr2, cr) + def test_main(): test_support.run_unittest(CryptTestCase) |