Ejemplo n.º 1
0
 def test_rename_only_target_dir_no_basename(self,
                                             remote_tmpdir: DriveFolder):
     remote_file = remote_tmpdir.new_file("filename")
     remote_file.upload_empty()
     remote_tmpdir.create_path("1/2/3")
     remote_file.rename("1/2/3")
     assert remote_tmpdir.child_from_path("1/2/3/filename") == remote_file
Ejemplo n.º 2
0
    def test_create_path(self, remote_tmpdir: DriveFolder):
        # depends on test_child_from_path
        depth = 3
        path = "/".join((random_string() for _ in range(0, depth)))
        folder1 = remote_tmpdir.create_path(path)
        assert folder1 == remote_tmpdir.child_from_path(path)
        folder2 = remote_tmpdir.create_path(path)
        assert folder1 == folder2

        # test . and ..
        assert remote_tmpdir.create_path(".") == remote_tmpdir
        folder = remote_tmpdir.create_path("./1/2a/../2b/")
        assert folder == remote_tmpdir.child_from_path("1/2b")
Ejemplo n.º 3
0
 def test_rename_subdir(self, remote_tmpdir: DriveFolder):
     remote_file = remote_tmpdir.new_file(random_string())
     remote_file.upload_empty()
     remote_tmpdir.create_path("1/2/3")
     remote_file.rename("1/2/3/b")
     assert remote_tmpdir.child_from_path("1/2/3/b") == remote_file