summaryrefslogtreecommitdiffhomepage
path: root/test/test_static_chroot.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2022-04-11 21:05:14 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2022-04-11 21:05:14 +0100
commit0f725346603f4de4473d12da502104b188ac02a4 (patch)
tree7f8254a816965d49c4d6d98da34f00c81894f7e8 /test/test_static_chroot.py
parentaeed86c6829c62359e79f239b849766efb8857a7 (diff)
downloadunit-0f725346603f4de4473d12da502104b188ac02a4.tar.gz
unit-0f725346603f4de4473d12da502104b188ac02a4.tar.bz2
Tests: style.
Diffstat (limited to 'test/test_static_chroot.py')
-rw-r--r--test/test_static_chroot.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/test/test_static_chroot.py b/test/test_static_chroot.py
index 62288807..b896a9b9 100644
--- a/test/test_static_chroot.py
+++ b/test/test_static_chroot.py
@@ -26,13 +26,14 @@ class TestStaticChroot(TestApplicationProto):
def update_action(self, share, chroot):
return self.conf(
- {"share": share, "chroot": chroot}, 'routes/0/action',
+ {"share": share, "chroot": chroot},
+ 'routes/0/action',
)
def get_custom(self, uri, host):
- return self.get(
- url=uri, headers={'Host': host, 'Connection': 'close'}
- )['status']
+ return self.get(url=uri, headers={'Host': host, 'Connection': 'close'})[
+ 'status'
+ ]
def test_static_chroot(self, temp_dir):
assert self.get(url='/dir/file')['status'] == 200, 'default chroot'
@@ -101,7 +102,8 @@ class TestStaticChroot(TestApplicationProto):
), 'chroot empty absolute'
assert 'success' in self.conf(
- {"share": ".$uri", "chroot": ""}, 'routes/0/action',
+ {"share": ".$uri", "chroot": ""},
+ 'routes/0/action',
), 'configure chroot empty relative'
assert (
@@ -120,13 +122,15 @@ class TestStaticChroot(TestApplicationProto):
assert self.get(url='/dir/file')['status'] == 403, 'relative chroot'
assert 'success' in self.conf(
- {"share": ".$uri"}, 'routes/0/action',
+ {"share": ".$uri"},
+ 'routes/0/action',
), 'configure relative share'
assert self.get(url=self.test_path)['status'] == 200, 'relative share'
assert 'success' in self.conf(
- {"share": ".$uri", "chroot": "."}, 'routes/0/action',
+ {"share": ".$uri", "chroot": "."},
+ 'routes/0/action',
), 'configure relative'
assert self.get(url=self.test_path)['status'] == 200, 'relative'
@@ -208,13 +212,16 @@ class TestStaticChroot(TestApplicationProto):
def test_static_chroot_invalid(self, temp_dir):
assert 'error' in self.conf(
- {"share": temp_dir, "chroot": True}, 'routes/0/action',
+ {"share": temp_dir, "chroot": True},
+ 'routes/0/action',
), 'configure chroot error'
assert 'error' in self.conf(
- {"share": temp_dir, "symlinks": "True"}, 'routes/0/action',
+ {"share": temp_dir, "symlinks": "True"},
+ 'routes/0/action',
), 'configure symlink error'
assert 'error' in self.conf(
- {"share": temp_dir, "mount": "True"}, 'routes/0/action',
+ {"share": temp_dir, "mount": "True"},
+ 'routes/0/action',
), 'configure mount error'
assert 'error' in self.update_action(