Skip to content

Commit 04c0a40

Browse files
[2.7] bpo-25287: Backport new tests for crypt and skip test_crypt on OpenBSD. (GH-4111). (#4112)
(cherry picked from commit f52dff6)
1 parent ef346a2 commit 04c0a40

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Lib/test/test_crypt.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1+
import sys
12
from test import test_support
23
import unittest
34

45
crypt = test_support.import_module('crypt')
56

7+
if sys.platform.startswith('openbsd'):
8+
raise unittest.SkipTest('The only supported method on OpenBSD is Blowfish')
9+
610
class CryptTestCase(unittest.TestCase):
711

812
def test_crypt(self):
9-
c = crypt.crypt('mypassword', 'ab')
10-
if test_support.verbose:
11-
print 'Test encryption: ', c
13+
cr = crypt.crypt('mypassword', 'ab')
14+
if cr is not None:
15+
cr2 = crypt.crypt('mypassword', cr)
16+
self.assertEqual(cr2, cr)
17+
1218

1319
def test_main():
1420
test_support.run_unittest(CryptTestCase)

0 commit comments

Comments
 (0)