Skip to content

Commit

Permalink
add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonc authored and mmerickel committed Aug 25, 2023
1 parent 26182b6 commit 2b74cc2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/pkgs/static_abspath_nulbyte/__init__.py
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions tests/pkgs/static_assetspec_nulbyte/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def includeme(config):
config.add_static_view('/', 'tests:fixtures/static')
7 changes: 7 additions & 0 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,17 @@ def test_sendfoobar(self):
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'
Expand Down

0 comments on commit 2b74cc2

Please sign in to comment.