summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-05-16 00:45:35 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-05-16 00:45:35 (GMT)
commitcfaf10ca61e4253da647896892cfdbc2472aa3a4 (patch)
treebfec822ce28a5c6fb6f3e4086ba93a6208a386eb /Lib/test/test_os.py
parentacbb786596ee451af79fc7515a15d1d1ae4ed867 (diff)
downloadcpython-cfaf10ca61e4253da647896892cfdbc2472aa3a4.zip
cpython-cfaf10ca61e4253da647896892cfdbc2472aa3a4.tar.gz
cpython-cfaf10ca61e4253da647896892cfdbc2472aa3a4.tar.bz2
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. ........
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 5f23336..503244a 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -216,7 +216,6 @@ class StatAttributeTests(unittest.TestCase):
if not hasattr(os, "statvfs"):
return
- import statvfs
try:
result = os.statvfs(self.fname)
except OSError as e:
@@ -226,16 +225,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: