summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_shutil.py
diff options
context:
space:
mode:
authorGiampaolo Rodola' <g.rodola@gmail.com>2011-07-01 11:55:36 (GMT)
committerGiampaolo Rodola' <g.rodola@gmail.com>2011-07-01 11:55:36 (GMT)
commit210e7ca032d51b8368359c02ad505dbd5f633cc9 (patch)
tree6558f76ed9be7add62a771d5b09b52e94f058fa3 /Lib/test/test_shutil.py
parent59929d9877e2968c38e672f14cd92aa63bfe9c4b (diff)
downloadcpython-210e7ca032d51b8368359c02ad505dbd5f633cc9.zip
cpython-210e7ca032d51b8368359c02ad505dbd5f633cc9.tar.gz
cpython-210e7ca032d51b8368359c02ad505dbd5f633cc9.tar.bz2
Issue #12442: add shutil.disk_usage()
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r--Lib/test/test_shutil.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index ad31f47..20e9412 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -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):