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

Side by Side Diff: tests/scm_unittest.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/gclient_utils_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unit tests for scm.py.""" 6 """Unit tests for scm.py."""
7 7
8 # pylint: disable=E1101,W0403 8 # pylint: disable=E1101,W0403
9 9
10 # Fixes include path. 10 # Fixes include path.
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 # - svn move a directory and svn rename files in it 269 # - svn move a directory and svn rename files in it
270 self._capture(['move', 'foo', 'foo2']) 270 self._capture(['move', 'foo', 'foo2'])
271 self._capture( 271 self._capture(
272 ['move', 272 ['move',
273 scm.os.path.join('foo2', 'origin'), 273 scm.os.path.join('foo2', 'origin'),
274 scm.os.path.join('foo2', 'o')]) 274 scm.os.path.join('foo2', 'o')])
275 scm.os.remove(scm.os.path.join(self.svn_root, 'origin')) 275 scm.os.remove(scm.os.path.join(self.svn_root, 'origin'))
276 self._capture( 276 self._capture(
277 ['propset', 'foo', 'bar', 277 ['propset', 'foo', 'bar',
278 scm.os.path.join(self.svn_root, 'prout', 'origin')]) 278 scm.os.path.join(self.svn_root, 'prout', 'origin')])
279 fake_repos.rmtree(scm.os.path.join(self.svn_root, 'prout')) 279 fake_repos.gclient_utils.rmtree(scm.os.path.join(self.svn_root, 'prout'))
280 with open(scm.os.path.join(self.svn_root, 'faa'), 'w') as f: 280 with open(scm.os.path.join(self.svn_root, 'faa'), 'w') as f:
281 f.write('eh') 281 f.write('eh')
282 with open(scm.os.path.join(self.svn_root, 'faala'), 'w') as f: 282 with open(scm.os.path.join(self.svn_root, 'faala'), 'w') as f:
283 f.write('oh') 283 f.write('oh')
284 self._capture(['add', scm.os.path.join(self.svn_root, 'faala')]) 284 self._capture(['add', scm.os.path.join(self.svn_root, 'faala')])
285 added_and_removed = scm.os.path.join(self.svn_root, 'added_and_removed') 285 added_and_removed = scm.os.path.join(self.svn_root, 'added_and_removed')
286 with open(added_and_removed, 'w') as f: 286 with open(added_and_removed, 'w') as f:
287 f.write('oh') 287 f.write('oh')
288 self._capture(['add', added_and_removed]) 288 self._capture(['add', added_and_removed])
289 scm.os.remove(added_and_removed) 289 scm.os.remove(added_and_removed)
290 290
291 scm.SVN.Revert(self.svn_root) 291 scm.SVN.Revert(self.svn_root)
292 self._capture(['update', '--revision', 'base']) 292 self._capture(['update', '--revision', 'base'])
293 293
294 self.assertTree(self.tree, self.svn_root) 294 self.assertTree(self.tree, self.svn_root)
295 # Asserting the tree is not sufficient, svn status must come out clear too. 295 # Asserting the tree is not sufficient, svn status must come out clear too.
296 self.assertEquals('', self._capture(['status'])) 296 self.assertEquals('', self._capture(['status']))
297 297
298 298
299 if __name__ == '__main__': 299 if __name__ == '__main__':
300 import unittest 300 import unittest
301 unittest.main() 301 unittest.main()
302 302
303 # vim: ts=2:sw=2:tw=80:et: 303 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « tests/gclient_utils_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698