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
e1266782
Commit
e1266782
authored
May 16, 2012
by
Giampaolo Rodola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#14807: fix BB failures on Windows - avoid to to rely too many details of the mode string.
parent
12ea86ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
11 deletions
+22
-11
Lib/test/test_stat.py
Lib/test/test_stat.py
+22
-11
No files found.
Lib/test/test_stat.py
View file @
e1266782
...
@@ -23,24 +23,35 @@ class TestFilemode(unittest.TestCase):
...
@@ -23,24 +23,35 @@ class TestFilemode(unittest.TestCase):
def
test_mode
(
self
):
def
test_mode
(
self
):
with
open
(
TESTFN
,
'w'
):
with
open
(
TESTFN
,
'w'
):
pass
pass
os
.
chmod
(
TESTFN
,
0o700
)
if
os
.
name
==
'posix'
:
self
.
assertEqual
(
get_mode
(),
'-rwx------'
)
os
.
chmod
(
TESTFN
,
0o700
)
os
.
chmod
(
TESTFN
,
0o070
)
self
.
assertEqual
(
get_mode
(),
'-rwx------'
)
self
.
assertEqual
(
get_mode
(),
'----rwx---'
)
os
.
chmod
(
TESTFN
,
0o070
)
os
.
chmod
(
TESTFN
,
0o007
)
self
.
assertEqual
(
get_mode
(),
'----rwx---'
)
self
.
assertEqual
(
get_mode
(),
'-------rwx'
)
os
.
chmod
(
TESTFN
,
0o007
)
os
.
chmod
(
TESTFN
,
0o444
)
self
.
assertEqual
(
get_mode
(),
'-------rwx'
)
self
.
assertEqual
(
get_mode
(),
'-r--r--r--'
)
os
.
chmod
(
TESTFN
,
0o444
)
self
.
assertEqual
(
get_mode
(),
'-r--r--r--'
)
else
:
os
.
chmod
(
TESTFN
,
0o700
)
self
.
assertEqual
(
get_mode
()[:
3
],
'-rw'
)
def
test_directory
(
self
):
def
test_directory
(
self
):
os
.
mkdir
(
TESTFN
)
os
.
mkdir
(
TESTFN
)
os
.
chmod
(
TESTFN
,
0o700
)
os
.
chmod
(
TESTFN
,
0o700
)
self
.
assertEqual
(
get_mode
(),
'drwx------'
)
if
os
.
name
==
'posix'
:
self
.
assertEqual
(
get_mode
(),
'drwx------'
)
else
:
self
.
assertEqual
(
get_mode
()[
0
],
'd'
)
@
unittest
.
skipUnless
(
hasattr
(
os
,
'symlink'
),
'os.symlink not available'
)
@
unittest
.
skipUnless
(
hasattr
(
os
,
'symlink'
),
'os.symlink not available'
)
def
test_link
(
self
):
def
test_link
(
self
):
os
.
symlink
(
os
.
getcwd
(),
TESTFN
)
try
:
self
.
assertEqual
(
get_mode
()[
0
],
'l'
)
os
.
symlink
(
os
.
getcwd
(),
TESTFN
)
except
(
OSError
,
NotImplementedError
)
as
err
:
raise
unittest
.
SkipTest
(
str
(
err
))
else
:
self
.
assertEqual
(
get_mode
()[
0
],
'l'
)
@
unittest
.
skipUnless
(
hasattr
(
os
,
'mkfifo'
),
'os.mkfifo not available'
)
@
unittest
.
skipUnless
(
hasattr
(
os
,
'mkfifo'
),
'os.mkfifo not available'
)
def
test_fifo
(
self
):
def
test_fifo
(
self
):
...
...
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