mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #12442: add shutil.disk_usage()
This commit is contained in:
parent
59929d9877
commit
210e7ca032
6 changed files with 77 additions and 1 deletions
|
@ -728,6 +728,16 @@ class TestShutil(unittest.TestCase):
|
|||
unregister_unpack_format('Boo2')
|
||||
self.assertEqual(get_unpack_formats(), formats)
|
||||
|
||||
@unittest.skipUnless(hasattr(shutil, 'disk_usage'),
|
||||
"disk_usage not available on this platform")
|
||||
def test_disk_usage(self):
|
||||
usage = shutil.disk_usage(os.getcwd())
|
||||
self.assertTrue(usage.total > 0)
|
||||
self.assertTrue(usage.used > 0)
|
||||
self.assertTrue(usage.free >= 0)
|
||||
self.assertTrue(usage.total >= usage.used)
|
||||
self.assertTrue(usage.total > usage.free)
|
||||
|
||||
|
||||
class TestMove(unittest.TestCase):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue