Files
cpython/Lib/test/test_crypt.py
Serhiy Storchaka 04c0a4038e [2.7] bpo-25287: Backport new tests for crypt and skip test_crypt on OpenBSD. (GH-4111). (#4112)
(cherry picked from commit f52dff611cff2fb9e90340b4787eda50ab2d40c6)
2017-10-24 23:35:22 +03:00

24 lines
556 B
Python

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):
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)
if __name__ == "__main__":
test_main()