summaryrefslogtreecommitdiffhomepage
path: root/test/test_asgi_lifespan.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2020-10-07 23:18:43 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2020-10-07 23:18:43 +0100
commit6ec0ff35964c7805712d978625949f72ff5a63bc (patch)
treef64a1901993fbc7e6a75ca6335fbbd291c8cce56 /test/test_asgi_lifespan.py
parent645683f432d742f42f2769f589fe769585fb7aa0 (diff)
downloadunit-6ec0ff35964c7805712d978625949f72ff5a63bc.tar.gz
unit-6ec0ff35964c7805712d978625949f72ff5a63bc.tar.bz2
Tests: minor fixes.
Diffstat (limited to 'test/test_asgi_lifespan.py')
-rw-r--r--test/test_asgi_lifespan.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/test_asgi_lifespan.py b/test/test_asgi_lifespan.py
index 3d6fdcce..c37a1aae 100644
--- a/test/test_asgi_lifespan.py
+++ b/test/test_asgi_lifespan.py
@@ -1,9 +1,11 @@
import os
-import pytest
from distutils.version import LooseVersion
+import pytest
+
+from conftest import option
+from conftest import public_dir
from unit.applications.lang.python import TestApplicationPython
-from conftest import option, public_dir
class TestASGILifespan(TestApplicationPython):
@@ -19,11 +21,16 @@ class TestASGILifespan(TestApplicationPython):
shutdown_path = option.test_dir + '/python/lifespan/empty/shutdown'
version_path = option.test_dir + '/python/lifespan/empty/version'
+ os.chmod(option.test_dir + '/python/lifespan/empty', 0o777)
+
open(startup_path, 'a').close()
+ os.chmod(startup_path, 0o777)
+
open(shutdown_path, 'a').close()
- open(version_path, 'a').close()
+ os.chmod(shutdown_path, 0o777)
- public_dir(option.test_dir + '/python/lifespan/empty')
+ open(version_path, 'a').close()
+ os.chmod(version_path, 0o777)
assert self.get()['status'] == 204