Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: bad9a580caaba5088bea569c9c6775dab12b8103 authored by Benjamin Peterson on 14 April 2018, 22:06:30 UTC
2.7.15rc1 version bump
Tip revision: bad9a58
test_crypt.py
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()
back to top