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

Commit174d6e6

Browse files
[TestRemoteOperations] New tests for rmdirs are added.
1 parentac89cd8 commit174d6e6

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

‎tests/test_remote.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,58 @@ def test_rmdirs(self):
117117
assertself.operations.rmdirs(path,ignore_errors=False)isTrue
118118
assertnotos.path.exists(path)
119119

120+
deftest_rmdirs__01_with_subfolder(self):
121+
# folder with subfolder
122+
path=self.operations.mkdtemp()
123+
assertos.path.exists(path)
124+
125+
dir1=os.path.join(path,"dir1")
126+
assertnotos.path.exists(dir1)
127+
128+
self.operations.makedirs(dir1)
129+
assertos.path.exists(dir1)
130+
131+
assertself.operations.rmdirs(path,ignore_errors=False)isTrue
132+
assertnotos.path.exists(path)
133+
assertnotos.path.exists(dir1)
134+
135+
deftest_rmdirs__02_with_file(self):
136+
# folder with file
137+
path=self.operations.mkdtemp()
138+
assertos.path.exists(path)
139+
140+
file1=os.path.join(path,"file1.txt")
141+
assertnotos.path.exists(file1)
142+
143+
self.operations.touch(file1)
144+
assertos.path.exists(file1)
145+
146+
assertself.operations.rmdirs(path,ignore_errors=False)isTrue
147+
assertnotos.path.exists(path)
148+
assertnotos.path.exists(file1)
149+
150+
deftest_rmdirs__03_with_subfolder_and_file(self):
151+
# folder with subfolder and file
152+
path=self.operations.mkdtemp()
153+
assertos.path.exists(path)
154+
155+
dir1=os.path.join(path,"dir1")
156+
assertnotos.path.exists(dir1)
157+
158+
self.operations.makedirs(dir1)
159+
assertos.path.exists(dir1)
160+
161+
file1=os.path.join(dir1,"file1.txt")
162+
assertnotos.path.exists(file1)
163+
164+
self.operations.touch(file1)
165+
assertos.path.exists(file1)
166+
167+
assertself.operations.rmdirs(path,ignore_errors=False)isTrue
168+
assertnotos.path.exists(path)
169+
assertnotos.path.exists(dir1)
170+
assertnotos.path.exists(file1)
171+
120172
deftest_rmdirs__try_to_delete_nonexist_path(self):
121173
path="/root/test_dir"
122174

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp