Skip to content

[2.7] bpo-25287: Improve test_crypt and skip it on OpenBSD. (GH-4111). #4112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Lib/test/test_crypt.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down