summaryrefslogtreecommitdiff
path: root/Lib/test/test_crypt.py
blob: 7cd9c71981a67e185c0a3dac998159b21f7d3764 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()