• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import sys
2from test import test_support
3import unittest
4
5crypt = test_support.import_module('crypt')
6
7if sys.platform.startswith('openbsd'):
8    raise unittest.SkipTest('The only supported method on OpenBSD is Blowfish')
9
10class CryptTestCase(unittest.TestCase):
11
12    def test_crypt(self):
13        cr = crypt.crypt('mypassword', 'ab')
14        if cr is not None:
15            cr2 = crypt.crypt('mypassword', cr)
16            self.assertEqual(cr2, cr)
17
18
19def test_main():
20    test_support.run_unittest(CryptTestCase)
21
22if __name__ == "__main__":
23    test_main()
24