Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b386f6a5
Commit
b386f6a5
authored
Dec 23, 2003
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
As part of fixing bug #829532, add a test case that exercises os.makedirs
parent
6fccc8a9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
1 deletion
+36
-1
Lib/test/test_os.py
Lib/test/test_os.py
+36
-1
No files found.
Lib/test/test_os.py
View file @
b386f6a5
...
...
@@ -301,12 +301,47 @@ class WalkTests(unittest.TestCase):
os
.
rmdir
(
join
(
root
,
name
))
os
.
rmdir
(
test_support
.
TESTFN
)
class
MakedirTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
os
.
mkdir
(
test_support
.
TESTFN
)
def
test_makedir
(
self
):
base
=
test_support
.
TESTFN
path
=
os
.
path
.
join
(
base
,
'dir1'
,
'dir2'
,
'dir3'
)
os
.
makedirs
(
path
)
# Should work
path
=
os
.
path
.
join
(
base
,
'dir1'
,
'dir2'
,
'dir3'
,
'dir4'
)
os
.
makedirs
(
path
)
# Try paths with a '.' in them
self
.
failUnlessRaises
(
OSError
,
os
.
makedirs
,
os
.
curdir
)
path
=
os
.
path
.
join
(
base
,
'dir1'
,
'dir2'
,
'dir3'
,
'dir4'
,
'dir5'
,
os
.
curdir
)
os
.
makedirs
(
path
)
path
=
os
.
path
.
join
(
base
,
'dir1'
,
os
.
curdir
,
'dir2'
,
'dir3'
,
'dir4'
,
'dir5'
,
'dir6'
)
os
.
makedirs
(
path
)
def
tearDown
(
self
):
path
=
os
.
path
.
join
(
test_support
.
TESTFN
,
'dir1'
,
'dir2'
,
'dir3'
,
'dir4'
,
'dir5'
,
'dir6'
)
# If the tests failed, the bottom-most directory ('../dir6')
# may not have been created, so we look for the outermost directory
# that exists.
while
not
os
.
path
.
exists
(
path
)
and
path
!=
test_support
.
TESTFN
:
path
=
os
.
path
.
dirname
(
path
)
os
.
removedirs
(
path
)
def
test_main
():
test_support
.
run_unittest
(
TemporaryFileTests
,
StatAttributeTests
,
EnvironTests
,
WalkTests
WalkTests
,
MakedirTests
,
)
if
__name__
==
"__main__"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment