summaryrefslogtreecommitdiffhomepage
path: root/test/test_python_isolation.py
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2023-05-10 10:29:16 -0700
committerKonstantin Pavlov <thresh@nginx.com>2023-05-10 10:29:16 -0700
commit69235c513277c64b513447d9b92c3c03d616f577 (patch)
tree0780c92ba28d92b547c85ea0bee5e3040e14dee2 /test/test_python_isolation.py
parentb9bc222021e77bbdfb12576b3e315b962cf6b399 (diff)
parentfaf97dc06058de1c929af33a68adb34d3932b374 (diff)
downloadunit-69235c513277c64b513447d9b92c3c03d616f577.tar.gz
unit-69235c513277c64b513447d9b92c3c03d616f577.tar.bz2
Merged with the default branch.1.30.0-1
Diffstat (limited to 'test/test_python_isolation.py')
-rw-r--r--test/test_python_isolation.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/test_python_isolation.py b/test/test_python_isolation.py
index 6d4ffaf3..c524aea0 100644
--- a/test/test_python_isolation.py
+++ b/test/test_python_isolation.py
@@ -20,13 +20,13 @@ class TestPythonIsolation(TestApplicationPython):
).decode()
pid = re.search(
- r'(\d+)\s*unit: "' + app_name + '" application', output
+ fr'(\d+)\s*unit: "{app_name}" application', output
).group(1)
- cgroup = '/proc/' + pid + '/cgroup'
+ cgroup = f'/proc/{pid}/cgroup'
if not os.path.isfile(cgroup):
- pytest.skip('no cgroup at ' + cgroup)
+ pytest.skip(f'no cgroup at {cgroup}')
with open(cgroup, 'r') as f:
return f.read().rstrip()
@@ -59,7 +59,7 @@ class TestPythonIsolation(TestApplicationPython):
self.load('ns_inspect', isolation=isolation)
assert (
- self.getjson(url='/?path=' + temp_dir)['body']['FileExists']
+ self.getjson(url=f'/?path={temp_dir}')['body']['FileExists']
== False
), 'temp_dir does not exists in rootfs'
@@ -87,7 +87,7 @@ class TestPythonIsolation(TestApplicationPython):
isolation = {'rootfs': temp_dir, 'automount': {'language_deps': False}}
self.load('empty', isolation=isolation)
- python_path = temp_dir + '/usr'
+ python_path = f'{temp_dir}/usr'
assert findmnt().find(python_path) == -1
assert self.get()['status'] != 200, 'disabled language_deps'
@@ -156,7 +156,7 @@ class TestPythonIsolation(TestApplicationPython):
pytest.skip('cgroup is not supported')
def set_two_cgroup_path(path, path2):
- script_path = option.test_dir + '/python/empty'
+ script_path = f'{option.test_dir}/python/empty'
assert 'success' in self.conf(
{
@@ -203,7 +203,7 @@ class TestPythonIsolation(TestApplicationPython):
pytest.skip('cgroup is not supported')
def check_invalid(path):
- script_path = option.test_dir + '/python/empty'
+ script_path = f'{option.test_dir}/python/empty'
assert 'error' in self.conf(
{
"listeners": {"*:7080": {"pass": "applications/empty"}},