예제 #1
0
 def test_root_and_path(self):
     self.assertEqual(main_app.safe_path_join(path="home", root="/root"),
                      "/root/home")
예제 #2
0
 def test_prepend_slash_no_root(self):
     self.assertEqual(main_app.safe_path_join(path="/file.txt", root=""),
                      "/file.txt")
예제 #3
0
 def test_prepend_slash_root_and_path(self):
     self.assertEqual(
         main_app.safe_path_join(path="/nested/file", root="/root"),
         "/root/nested/file",
     )
예제 #4
0
 def test_no_path(self):
     self.assertEqual(main_app.safe_path_join(path="", root="/home"),
                      "/home")