summaryrefslogtreecommitdiffhomepage
path: root/test/test_python_isolation.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2021-04-05 14:03:05 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2021-04-05 14:03:05 +0100
commit6c97a1a069f0ae8cf683c8364fb7f9dabc5e89cb (patch)
treea7eab02b6fc63ff8d1a1329a090162715371aa62 /test/test_python_isolation.py
parent46d8567dd7c2a9af025f1de13084a9efd7118e20 (diff)
downloadunit-6c97a1a069f0ae8cf683c8364fb7f9dabc5e89cb.tar.gz
unit-6c97a1a069f0ae8cf683c8364fb7f9dabc5e89cb.tar.bz2
Tests: style.
Diffstat (limited to '')
-rw-r--r--test/test_python_isolation.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/test/test_python_isolation.py b/test/test_python_isolation.py
index 680f2c03..93f85264 100644
--- a/test/test_python_isolation.py
+++ b/test/test_python_isolation.py
@@ -1,5 +1,5 @@
-
import pytest
+
from unit.applications.lang.python import TestApplicationPython
from unit.option import option
from unit.utils import findmnt
@@ -32,7 +32,7 @@ class TestPythonIsolation(TestApplicationPython):
isolation['namespaces'] = {
'mount': True,
'credential': True,
- 'pid': True
+ 'pid': True,
}
self.load('ns_inspect', isolation=isolation)
@@ -43,8 +43,7 @@ class TestPythonIsolation(TestApplicationPython):
), 'temp_dir does not exists in rootfs'
assert (
- self.getjson(url='/?path=/proc/self')['body']['FileExists']
- == True
+ self.getjson(url='/?path=/proc/self')['body']['FileExists'] == True
), 'no /proc/self'
assert (
@@ -66,15 +65,12 @@ class TestPythonIsolation(TestApplicationPython):
if not is_su:
pytest.skip('requires root')
- isolation = {
- 'rootfs': temp_dir,
- 'automount': {'language_deps': False}
- }
+ isolation = {'rootfs': temp_dir, 'automount': {'language_deps': False}}
self.load('empty', isolation=isolation)
assert findmnt().find(temp_dir) == -1
- assert (self.get()['status'] != 200), 'disabled language_deps'
+ assert self.get()['status'] != 200, 'disabled language_deps'
assert findmnt().find(temp_dir) == -1
isolation['automount']['language_deps'] = True
@@ -82,7 +78,7 @@ class TestPythonIsolation(TestApplicationPython):
self.load('empty', isolation=isolation)
assert findmnt().find(temp_dir) == -1
- assert (self.get()['status'] == 200), 'enabled language_deps'
+ assert self.get()['status'] == 200, 'enabled language_deps'
assert waitformount(temp_dir), 'language_deps mount'
self.conf({"listeners": {}, "applications": {}})
@@ -90,8 +86,6 @@ class TestPythonIsolation(TestApplicationPython):
assert waitforunmount(temp_dir), 'language_deps unmount'
def test_python_isolation_procfs(self, is_su, temp_dir):
- isolation_features = option.available['features']['isolation'].keys()
-
if not is_su:
pytest.skip('requires root')