summaryrefslogtreecommitdiffhomepage
path: root/test/test_python_atexit.py
blob: a115a19290e7b4f56dc7c2b8a59b4dd8703b38a5 (plain) (blame)
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
import os
import time
import unittest
import unit

class TestUnitPythonAtExit(unit.TestUnitApplicationPython):

    def setUpClass():
        unit.TestUnit().check_modules('python')

    def test_python_atexit(self):
        self.load('atexit')

        self.get(headers={
            'Host': 'localhost',
            'Test-Dir': self.testdir,
            'Connection': 'close'
        })

        self.conf({
            "listeners": {},
            "applications": {}
        })

        time.sleep(0.2)   # wait for 'atexit' file

        self.assertEqual(os.path.exists(self.testdir + '/atexit'), True,
            'python atexit')

if __name__ == '__main__':
    unittest.main()