def test_root_and_path(self): self.assertEqual(main_app.safe_path_join(path="home", root="/root"), "/root/home")
def test_prepend_slash_no_root(self): self.assertEqual(main_app.safe_path_join(path="/file.txt", root=""), "/file.txt")
def test_prepend_slash_root_and_path(self): self.assertEqual( main_app.safe_path_join(path="/nested/file", root="/root"), "/root/nested/file", )
def test_no_path(self): self.assertEqual(main_app.safe_path_join(path="", root="/home"), "/home")