Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(15)

Unified Diff: Lib/test/test_shutil.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_runpy.py ('k') | Lib/test/test_signal.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_shutil.py Tue Jul 26 09:37:46 2011 +0300
+++ b/Lib/test/test_shutil.py Mon Jul 25 09:47:18 2011 -0400
@@ -107,7 +107,8 @@
self.errorState = 0
os.mkdir(TESTFN)
self.childpath = os.path.join(TESTFN, 'a')
- support.create_empty_file(self.childpath)
+ f = open(self.childpath, 'w')
+ f.close()
old_dir_mode = os.stat(TESTFN).st_mode
old_child_mode = os.stat(self.childpath).st_mode
# Make unwritable.
@@ -155,7 +156,7 @@
def test_rmtree_dont_delete_file(self):
# When called on a file instead of a directory, don't delete it.
handle, path = tempfile.mkstemp()
- os.close(handle)
+ os.fdopen(handle).close()
self.assertRaises(OSError, shutil.rmtree, path)
os.remove(path)
@@ -421,7 +422,7 @@
self.assertEqual(os.stat(file1).st_mode, os.stat(file2).st_mode)
@unittest.skipUnless(hasattr(os, 'chmod'), 'requires os.chmod')
- @unittest.skipUnless(hasattr(os, 'utime'), 'requires os.utime')
+ @unittest.skipUnless(hasattr(os, 'chmod'), 'requires os.utime')
def test_copy2(self):
# Ensure that the copied file exists and has the same mode and
# modification time bits.
@@ -728,16 +729,6 @@
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.assertGreater(usage.total, 0)
- self.assertGreater(usage.used, 0)
- self.assertGreaterEqual(usage.free, 0)
- self.assertGreaterEqual(usage.total, usage.used)
- self.assertGreater(usage.total, usage.free)
-
class TestMove(unittest.TestCase):
« no previous file with comments | « Lib/test/test_runpy.py ('k') | Lib/test/test_signal.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+