summaryrefslogtreecommitdiffhomepage
path: root/test/test_go_isolation_rootfs.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2023-06-14 18:20:09 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2023-06-14 18:20:09 +0100
commitc183bd8749a19477390f8cb77efe5f6d223f0905 (patch)
tree4e821e9cb07be9a86bf2d442acb3ea6740ba5a99 /test/test_go_isolation_rootfs.py
parentc6d05191a069ac150cc8eb2bece75cf79c0a465a (diff)
downloadunit-c183bd8749a19477390f8cb77efe5f6d223f0905.tar.gz
unit-c183bd8749a19477390f8cb77efe5f6d223f0905.tar.bz2
Tests: get rid of classes in test files.
Class usage came from the unittest framework and it was always redundant after migration to the pytest. This commit removes classes from files containing tests to make them more readable and understandable.
Diffstat (limited to 'test/test_go_isolation_rootfs.py')
-rw-r--r--test/test_go_isolation_rootfs.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/test/test_go_isolation_rootfs.py b/test/test_go_isolation_rootfs.py
index 1f5e93a1..b627b515 100644
--- a/test/test_go_isolation_rootfs.py
+++ b/test/test_go_isolation_rootfs.py
@@ -1,5 +1,4 @@
-import pytest
-from unit.applications.lang.go import TestApplicationGo
+from unit.applications.lang.go import ApplicationGo
prerequisites = {
'modules': {'go': 'all'},
@@ -7,16 +6,14 @@ prerequisites = {
'privileged_user': True,
}
+client = ApplicationGo()
-class TestGoIsolationRootfs(TestApplicationGo):
- def test_go_isolation_rootfs_chroot(self, temp_dir):
- isolation = {'rootfs': temp_dir}
- self.load('ns_inspect', isolation=isolation)
+def test_go_isolation_rootfs_chroot(temp_dir):
+ client.load('ns_inspect', isolation={'rootfs': temp_dir})
- obj = self.getjson(url='/?file=/go/app')['body']
+ obj = client.getjson(url='/?file=/go/app')['body']
+ assert obj['FileExists'], 'app relative to rootfs'
- assert obj['FileExists'], 'app relative to rootfs'
-
- obj = self.getjson(url='/?file=/bin/sh')['body']
- assert not obj['FileExists'], 'file should not exists'
+ obj = client.getjson(url='/?file=/bin/sh')['body']
+ assert not obj['FileExists'], 'file should not exists'