Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cfaf10c

Browse files
committed
Merged revisions 63339 via svnmerge from
svn+ssh://[email protected]/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. ........
1 parent acbb786 commit cfaf10c

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

Lib/test/test_os.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ def test_statvfs_attributes(self):
216216
if not hasattr(os, "statvfs"):
217217
return
218218

219-
import statvfs
220219
try:
221220
result = os.statvfs(self.fname)
222221
except OSError as e:
@@ -226,16 +225,13 @@ def test_statvfs_attributes(self):
226225
return
227226

228227
# Make sure direct access works
229-
self.assertEquals(result.f_bfree, result[statvfs.F_BFREE])
228+
self.assertEquals(result.f_bfree, result[3])
230229

231-
# Make sure all the attributes are there
232-
members = dir(result)
233-
for name in dir(statvfs):
234-
if name[:2] == 'F_':
235-
attr = name.lower()
236-
self.assertEquals(getattr(result, attr),
237-
result[getattr(statvfs, name)])
238-
self.assert_(attr in members)
230+
# Make sure all the attributes are there.
231+
members = ('bsize', 'frsize', 'blocks', 'bfree', 'bavail', 'files',
232+
'ffree', 'favail', 'flag', 'namemax')
233+
for value, member in enumerate(members):
234+
self.assertEquals(getattr(result, 'f_' + member), result[value])
239235

240236
# Make sure that assignment really fails
241237
try:

0 commit comments

Comments
 (0)