mirror of
https://github.com/python/cpython.git
synced 2025-11-08 13:42:22 +00:00
Merged revisions 63339 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r63339 | brett.cannon | 2008-05-15 17:37:42 -0700 (Thu, 15 May 2008) | 2 lines Remove the last usage of statvfs in the stdlib. ........
This commit is contained in:
parent
acbb786596
commit
cfaf10ca61
1 changed files with 6 additions and 10 deletions
|
|
@ -216,7 +216,6 @@ class StatAttributeTests(unittest.TestCase):
|
||||||
if not hasattr(os, "statvfs"):
|
if not hasattr(os, "statvfs"):
|
||||||
return
|
return
|
||||||
|
|
||||||
import statvfs
|
|
||||||
try:
|
try:
|
||||||
result = os.statvfs(self.fname)
|
result = os.statvfs(self.fname)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
|
|
@ -226,16 +225,13 @@ class StatAttributeTests(unittest.TestCase):
|
||||||
return
|
return
|
||||||
|
|
||||||
# Make sure direct access works
|
# Make sure direct access works
|
||||||
self.assertEquals(result.f_bfree, result[statvfs.F_BFREE])
|
self.assertEquals(result.f_bfree, result[3])
|
||||||
|
|
||||||
# Make sure all the attributes are there
|
# Make sure all the attributes are there.
|
||||||
members = dir(result)
|
members = ('bsize', 'frsize', 'blocks', 'bfree', 'bavail', 'files',
|
||||||
for name in dir(statvfs):
|
'ffree', 'favail', 'flag', 'namemax')
|
||||||
if name[:2] == 'F_':
|
for value, member in enumerate(members):
|
||||||
attr = name.lower()
|
self.assertEquals(getattr(result, 'f_' + member), result[value])
|
||||||
self.assertEquals(getattr(result, attr),
|
|
||||||
result[getattr(statvfs, name)])
|
|
||||||
self.assert_(attr in members)
|
|
||||||
|
|
||||||
# Make sure that assignment really fails
|
# Make sure that assignment really fails
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue