File: test_threading.py

package info (click to toggle)
m2crypto 0.46.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,952 kB
  • sloc: python: 22,921; makefile: 213; ansic: 94; sh: 17
file content (41 lines) | stat: -rw-r--r-- 914 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python

"""Unit tests for M2Crypto.threading.

Copyright (C) 2007 Open Source Applications Foundation. All Rights Reserved.
"""
from M2Crypto import threading as m2threading, Rand
from tests import unittest


class ThreadingTestCase(unittest.TestCase):

    def setUp(self):
        m2threading.init()

    def tearDown(self):
        m2threading.cleanup()

    def test_pass(self):
        pass

    def test_multiInitCleanup(self):
        m2threading.init()
        m2threading.init()
        m2threading.cleanup()
        m2threading.cleanup()

        m2threading.init()
        m2threading.cleanup()


def suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.TestLoader().loadTestsFromTestCase(ThreadingTestCase))
    return suite


if __name__ == "__main__":
    Rand.load_file("randpool.dat", -1)
    unittest.TextTestRunner().run(suite())
    Rand.save_file("randpool.dat")