示例#1
0
 def test_collapses_multiple_path_parts(self):
     assert collapse_path_parts(
         "/foo/bar/baz/buz.html") == "/foo/bar%2Fbaz%2Fbuz.html"
示例#2
0
 def test_collapses_path_parts(self):
     assert collapse_path_parts(
         "/foo/bar/baz.html") == "/foo/bar%2Fbaz.html"
示例#3
0
 def test_collapses_third_dir(self):
     assert collapse_path_parts("/foo/bar/baz/") == "/foo/bar%2Fbaz%2F"
示例#4
0
 def test_doesnt_collapse_one_dir(self):
     assert collapse_path_parts("/foo/") == "/foo/"
示例#5
0
 def test_doesnt_collapse_two_parts(self):
     assert collapse_path_parts("/foo/bar.html") == "/foo/bar.html"
示例#6
0
 def test_doesnt_collapse_root(self):
     assert collapse_path_parts("/") == "/"
示例#7
0
 def test_doesnt_collapse_one_part(self):
     assert collapse_path_parts("/foo.html") == "/foo.html"
示例#8
0
 def test_collapses_fourth_dir(self):
     assert collapse_path_parts("/foo/bar/baz/buz/") == "/foo/bar%2Fbaz%2Fbuz%2F"
示例#9
0
 def test_doesnt_collapse_nothing(self):
     assert collapse_path_parts("") == ""
示例#10
0
 def test_collapses_third_dir(self):
     assert collapse_path_parts("/foo/bar/baz/") == "/foo/bar%2Fbaz%2F"
示例#11
0
 def test_collapses_multiple_path_parts(self):
     assert collapse_path_parts("/foo/bar/baz/buz.html") == "/foo/bar%2Fbaz%2Fbuz.html"
示例#12
0
 def test_collapses_path_parts(self):
     assert collapse_path_parts("/foo/bar/baz.html") == "/foo/bar%2Fbaz.html"
示例#13
0
 def test_doesnt_collapse_two_parts(self):
     assert collapse_path_parts("/foo/bar.html") == "/foo/bar.html"
示例#14
0
 def test_doesnt_collapse_one_dir(self):
     assert collapse_path_parts("/foo/") == "/foo/"
示例#15
0
 def test_collapses_fourth_dir(self):
     assert collapse_path_parts(
         "/foo/bar/baz/buz/") == "/foo/bar%2Fbaz%2Fbuz%2F"
示例#16
0
def collapse_path_parts(request):
    collapsed = utils.collapse_path_parts(request.line.uri.path.raw)
    request.line.uri.path = request.context['path'] = Path(collapsed)
示例#17
0
 def test_doesnt_collapse_nothing(self):
     assert collapse_path_parts("") == ""
示例#18
0
 def test_doesnt_collapse_one_part(self):
     assert collapse_path_parts("/foo.html") == "/foo.html"
示例#19
0
def collapse_path_parts(request):
    collapsed = utils.collapse_path_parts(request.line.uri.path.raw)
    request.line.uri.path = request.context['path'] = Path(collapsed)
示例#20
0
 def test_doesnt_collapse_root(self):
     assert collapse_path_parts("/") == "/"