Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Unified Diff: tests/gclient_utils_test.py

Issue 6628032: Shorten RemoveDirectory and rename to rmtree. Remove rmtree from fake_repos. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: rebase against trunk Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/fake_repos.py ('k') | tests/scm_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gclient_utils_test.py
diff --git a/tests/gclient_utils_test.py b/tests/gclient_utils_test.py
index 4b9ebf2a57925f9445bd1bcdb72931f643130c9e..8027675b0e8b21e91c950b146f09354c0c08aa05 100755
--- a/tests/gclient_utils_test.py
+++ b/tests/gclient_utils_test.py
@@ -9,7 +9,8 @@ import StringIO
# Fixes include path.
from super_mox import SuperMoxTestBase
-
+import trial_dir
+import os
import gclient_utils
@@ -32,8 +33,8 @@ class GclientUtilsUnittest(GclientUtilBase):
'ParseXML', 'Popen',
'PrintableObject', 'RemoveDirectory', 'SoftClone', 'SplitUrlRevision',
'SyntaxErrorToError', 'WorkItem',
- 'errno', 'hack_subprocess', 'logging', 'os', 'Queue', 're', 'stat',
- 'subprocess', 'sys','threading', 'time', 'xml',
+ 'errno', 'hack_subprocess', 'logging', 'os', 'Queue', 're', 'rmtree',
+ 'stat', 'subprocess', 'sys','threading', 'time', 'xml',
]
# If this test fails, you should add the relevant test.
self.compareMembers(gclient_utils, members)
@@ -181,6 +182,24 @@ class SplitUrlRevisionTestCase(GclientUtilBase):
self.assertEquals(out_url, url)
+class GClientUtilsTest(trial_dir.TestCase):
+ def testHardToDelete(self):
+ # Use the fact that tearDown will delete the directory to make it hard to do
+ # so.
+ l1 = os.path.join(self.root_dir, 'l1')
+ l2 = os.path.join(l1, 'l2')
+ l3 = os.path.join(l2, 'l3')
+ f3 = os.path.join(l3, 'f3')
+ os.mkdir(l1)
+ os.mkdir(l2)
+ os.mkdir(l3)
+ gclient_utils.FileWrite(f3, 'foo')
+ os.chmod(f3, 0)
+ os.chmod(l3, 0)
+ os.chmod(l2, 0)
+ os.chmod(l1, 0)
+
+
if __name__ == '__main__':
import unittest
unittest.main()
« no previous file with comments | « tests/fake_repos.py ('k') | tests/scm_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698