OLD | NEW |
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 Loading... |
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: |
OLD | NEW |