diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2018-03-18 23:11:38 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2018-03-20 18:47:23 +0100 |
commit | 17f7ca77afa75cedaa60bf3db767119adba4a2ec (patch) | |
tree | 0c4ff5f475bce84a3e7e88ab83b32dd38892066c /tests/test_ssl_offline.py | |
parent | b977909fc93caa599e52943be25b7f6042a4c70b (diff) | |
download | m2crypto-17f7ca77afa75cedaa60bf3db767119adba4a2ec.tar.gz |
PEP8isation
Specially replace complicated construct with unittest2 to one import to
M2Crypto top module.
Also, Rand.load_file should have first parameter as bytes(), not str().
Diffstat (limited to 'tests/test_ssl_offline.py')
-rw-r--r-- | tests/test_ssl_offline.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/tests/test_ssl_offline.py b/tests/test_ssl_offline.py index 7cf803f..b9e2a1a 100644 --- a/tests/test_ssl_offline.py +++ b/tests/test_ssl_offline.py @@ -8,12 +8,9 @@ Copyright (C) 2009-2010 Heikki Toivonen. All Rights Reserved. """ import doctest -try: - import unittest2 as unittest -except ImportError: - import unittest from M2Crypto import Rand, SSL, X509 +from tests import unittest from tests.test_ssl import srv_host @@ -40,8 +37,7 @@ class ContextTestCase(unittest.TestCase): def test_ctx_set_default_verify_paths(self): ctx = SSL.Context() ctx.set_default_verify_paths() - self.assertTrue(True) # test will get here only if the - # previous won't fail + # test will get here only if the previous won't fail def test_map(self): from M2Crypto.SSL.Context import ctxmap, _ctxmap @@ -62,10 +58,10 @@ class ContextTestCase(unittest.TestCase): def suite(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(CheckerTestCase)) - suite.addTest(unittest.makeSuite(ContextTestCase)) - return suite + t_suite = unittest.TestSuite() + t_suite.addTest(unittest.makeSuite(CheckerTestCase)) + t_suite.addTest(unittest.makeSuite(ContextTestCase)) + return t_suite if __name__ == '__main__': |