summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-05-16 00:37:42 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-05-16 00:37:42 (GMT)
commit90f2cb422fb4226846ab81c21d3a140b92267f82 (patch)
tree7c31f59445fc7798da39992fec275d90b95e527a /Lib/test/test_os.py
parent2224817cdf2dd1bfd3efd8a0498f0c996fbc133e (diff)
downloadcpython-90f2cb422fb4226846ab81c21d3a140b92267f82.zip
cpython-90f2cb422fb4226846ab81c21d3a140b92267f82.tar.gz
cpython-90f2cb422fb4226846ab81c21d3a140b92267f82.tar.bz2
Remove the last usage of statvfs in the stdlib.
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index ddda156..4c00422 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -220,7 +220,6 @@ class StatAttributeTests(unittest.TestCase):
if not hasattr(os, "statvfs"):
return
- import statvfs
try:
result = os.statvfs(self.fname)
except OSError, e:
@@ -230,16 +229,13 @@ class StatAttributeTests(unittest.TestCase):
return
# 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
- members = dir(result)
- for name in dir(statvfs):
- if name[:2] == 'F_':
- attr = name.lower()
- self.assertEquals(getattr(result, attr),
- result[getattr(statvfs, name)])
- self.assert_(attr in members)
+ # Make sure all the attributes are there.
+ members = ('bsize', 'frsize', 'blocks', 'bfree', 'bavail', 'files',
+ 'ffree', 'favail', 'flag', 'namemax')
+ for value, member in enumerate(members):
+ self.assertEquals(getattr(result, 'f_' + member), result[value])
# Make sure that assignment really fails
try: