diff options
| author | Chris McDonough <chrism@plope.com> | 2023-08-21 18:06:29 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2023-08-21 18:06:29 -0400 |
| commit | 2af309223d6050feff3f85701a93166f3d4b5fee (patch) | |
| tree | 5a0cd5c7c2b7d83af3766133fc865e7269fc0ddb /tests | |
| parent | 021eb504a7d3d2aeeb0781a5f89a5467f90b13da (diff) | |
| download | pyramid-2af309223d6050feff3f85701a93166f3d4b5fee.tar.gz pyramid-2af309223d6050feff3f85701a93166f3d4b5fee.tar.bz2 pyramid-2af309223d6050feff3f85701a93166f3d4b5fee.zip | |
add integration tests
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/pkgs/static_abspath_nulbyte/__init__.py | 10 | ||||
| -rw-r--r-- | tests/pkgs/static_assetspec_nulbyte/__init__.py | 2 | ||||
| -rw-r--r-- | tests/test_integration.py | 7 |
3 files changed, 19 insertions, 0 deletions
diff --git a/tests/pkgs/static_abspath_nulbyte/__init__.py b/tests/pkgs/static_abspath_nulbyte/__init__.py new file mode 100644 index 000000000..a946fcdf9 --- /dev/null +++ b/tests/pkgs/static_abspath_nulbyte/__init__.py @@ -0,0 +1,10 @@ +import os + + +def includeme(config): + here = here = os.path.dirname(__file__) + static + static = os.path.normpath( + os.path.join(here, '..', '..', 'fixtures', 'statc') + ) + config.add_static_view('/', static) diff --git a/tests/pkgs/static_assetspec_nulbyte/__init__.py b/tests/pkgs/static_assetspec_nulbyte/__init__.py new file mode 100644 index 000000000..49cebab3e --- /dev/null +++ b/tests/pkgs/static_assetspec_nulbyte/__init__.py @@ -0,0 +1,2 @@ +def includeme(config): + config.add_static_view('/', 'tests:fixtures/static') diff --git a/tests/test_integration.py b/tests/test_integration.py index 0b55872d2..184368214 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -220,10 +220,17 @@ class TestEventOnlySubscribers(IntegrationBase, unittest.TestCase): class TestStaticAppUsingAbsPath(StaticAppBase, unittest.TestCase): package = 'tests.pkgs.static_abspath' + def test_nulbyte_chroot(self): + super_w_null = '/static/..\x00/' + res = self.testapp.get(f'/{super_w_null}', status=404) + class TestStaticAppUsingAssetSpec(StaticAppBase, unittest.TestCase): package = 'tests.pkgs.static_assetspec' + def test_nulbyte_chroot(self): + super_w_null = 'static/..\x00/' + res = self.testapp.get(f'/{super_w_null}', status=404) class TestStaticAppWithEncodings(IntegrationBase, unittest.TestCase): package = 'tests.pkgs.static_encodings' |
