Skip to content

Commit 16bf25f

Browse files
committed
Added testcase for an issue that may exist on windows
1 parent 179da58 commit 16bf25f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/flask_tests.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,21 @@ def test_safe_access(self):
817817
else:
818818
assert 0, 'expected exception'
819819

820+
# testcase for a security issue that may exist on windows systems
821+
import os
822+
import ntpath
823+
old_path = os.path
824+
os.path = ntpath
825+
try:
826+
try:
827+
f('..\\__init__.py')
828+
except NotFound:
829+
pass
830+
else:
831+
assert 0, 'expected exception'
832+
finally:
833+
os.path = old_path
834+
820835

821836
class SendfileTestCase(unittest.TestCase):
822837

0 commit comments

Comments
 (0)