diff options
author | Konstantin Pavlov <thresh@nginx.com> | 2022-06-02 16:51:49 +0400 |
---|---|---|
committer | Konstantin Pavlov <thresh@nginx.com> | 2022-06-02 16:51:49 +0400 |
commit | d9fddee1dbfc1f5d49c8f40386289d7188030952 (patch) | |
tree | 842a62b343ac33eba10e7a426a10b55bb1c46aed /test/test_static_chroot.py | |
parent | 420395ee2e7cd464e157c49bea3d74f15bf25f30 (diff) | |
parent | 0d48fe73c4450901622373e35f6ff3a944ec13d6 (diff) | |
download | unit-d9fddee1dbfc1f5d49c8f40386289d7188030952.tar.gz unit-d9fddee1dbfc1f5d49c8f40386289d7188030952.tar.bz2 |
Merged with the default branch.1.27.0-1
Diffstat (limited to '')
-rw-r--r-- | test/test_static_chroot.py | 27 |
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( |