Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

os_ops::rmdirs (local, remote) was refactored#207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
[TestRemoteOperations] New tests for rmdirs are added.
  • Loading branch information
@dmitry-lipetsk
dmitry-lipetsk committedMar 3, 2025
commit174d6e6442d7e663f79b45b9477e0684fda8d9ce
52 changes: 52 additions & 0 deletionstests/test_remote.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -117,6 +117,58 @@ def test_rmdirs(self):
assert self.operations.rmdirs(path, ignore_errors=False) is True
assert not os.path.exists(path)

def test_rmdirs__01_with_subfolder(self):
# folder with subfolder
path = self.operations.mkdtemp()
assert os.path.exists(path)

dir1 = os.path.join(path, "dir1")
assert not os.path.exists(dir1)

self.operations.makedirs(dir1)
assert os.path.exists(dir1)

assert self.operations.rmdirs(path, ignore_errors=False) is True
assert not os.path.exists(path)
assert not os.path.exists(dir1)

def test_rmdirs__02_with_file(self):
# folder with file
path = self.operations.mkdtemp()
assert os.path.exists(path)

file1 = os.path.join(path, "file1.txt")
assert not os.path.exists(file1)

self.operations.touch(file1)
assert os.path.exists(file1)

assert self.operations.rmdirs(path, ignore_errors=False) is True
assert not os.path.exists(path)
assert not os.path.exists(file1)

def test_rmdirs__03_with_subfolder_and_file(self):
# folder with subfolder and file
path = self.operations.mkdtemp()
assert os.path.exists(path)

dir1 = os.path.join(path, "dir1")
assert not os.path.exists(dir1)

self.operations.makedirs(dir1)
assert os.path.exists(dir1)

file1 = os.path.join(dir1, "file1.txt")
assert not os.path.exists(file1)

self.operations.touch(file1)
assert os.path.exists(file1)

assert self.operations.rmdirs(path, ignore_errors=False) is True
assert not os.path.exists(path)
assert not os.path.exists(dir1)
assert not os.path.exists(file1)

def test_rmdirs__try_to_delete_nonexist_path(self):
path = "/root/test_dir"

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp