def test_dots(self): self.assertEqual( utils.canonicalize_path('./../this/./is/./only/../a/./test.html'), '/this/is/a/test.html') self.assertEqual( utils.canonicalize_path('../this/./is/./only/../a/./test.html'), '/this/is/a/test.html')
def test_non_ascii(self): self.assertEqual(utils.canonicalize_path(u'/te\xa0\u2013st'), '/test')
def test_slashes(self): self.assertEqual(utils.canonicalize_path('//t//e///s/t'), '/t/e/s/t')
def test_lower(self): self.assertEqual(utils.canonicalize_path('/TEST'), '/test')