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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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.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') |
| 286 with open(added_and_removed, 'w') as f: |
| 287 f.write('oh') |
| 288 self._capture(['add', added_and_removed]) |
| 289 scm.os.remove(added_and_removed) |
285 | 290 |
286 scm.SVN.Revert(self.svn_root) | 291 scm.SVN.Revert(self.svn_root) |
287 self._capture(['update', '--revision', 'base']) | 292 self._capture(['update', '--revision', 'base']) |
288 | 293 |
289 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. |
| 296 self.assertEquals('', self._capture(['status'])) |
290 | 297 |
291 | 298 |
292 if __name__ == '__main__': | 299 if __name__ == '__main__': |
293 import unittest | 300 import unittest |
294 unittest.main() | 301 unittest.main() |
295 | 302 |
296 # vim: ts=2:sw=2:tw=80:et: | 303 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |