| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env 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 checkout.py.""" | 6 """Unit tests for checkout.py.""" |
| 7 | 7 |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import shutil | 10 import shutil |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 class FakeRepos(fake_repos.FakeReposBase): | 56 class FakeRepos(fake_repos.FakeReposBase): |
| 57 def populateSvn(self): | 57 def populateSvn(self): |
| 58 """Creates a few revisions of changes files.""" | 58 """Creates a few revisions of changes files.""" |
| 59 checkout.subprocess2.check_call( | 59 checkout.subprocess2.check_call( |
| 60 ['svn', 'checkout', 'svn://127.0.0.1/svn', self.svn_root, '-q', | 60 ['svn', 'checkout', 'svn://127.0.0.1/svn', self.svn_root, '-q', |
| 61 '--non-interactive', '--no-auth-cache', | 61 '--non-interactive', '--no-auth-cache', |
| 62 '--username', 'user1', '--password', 'foo']) | 62 '--username', 'user1', '--password', 'foo']) |
| 63 assert os.path.isdir(os.path.join(self.svn_root, '.svn')) | 63 assert os.path.isdir(os.path.join(self.svn_root, '.svn')) |
| 64 fs = {} | 64 fs = {} |
| 65 fs['trunk/origin'] = 'svn@1' | 65 fs['trunk/origin'] = 'svn@1' |
| 66 fs['trunk/codereview.settings'] = read( | 66 fs['trunk/codereview.settings'] = ( |
| 67 os.path.join(ROOT_DIR, 'svn_utils_test_data', 'codereview.settings')) | 67 '# Test data\n' |
| 68 fs['trunk/svn_utils_test.txt'] = read( | 68 'bar: pouet\n') |
| 69 os.path.join(ROOT_DIR, 'svn_utils_test_data', 'svn_utils_test.txt')) | 69 fs['trunk/svn_utils_test.txt'] = ( |
| 70 'a\n' |
| 71 'bb\n' |
| 72 'ccc\n' |
| 73 'dd\n' |
| 74 'e\n' |
| 75 'ff\n' |
| 76 'ggg\n' |
| 77 'hh\n' |
| 78 'i\n' |
| 79 'jj\n' |
| 80 'kkk\n' |
| 81 'll\n' |
| 82 'm\n' |
| 83 'nn\n' |
| 84 'ooo\n' |
| 85 'pp\n' |
| 86 'q\n') |
| 70 self._commit_svn(fs) | 87 self._commit_svn(fs) |
| 71 fs['trunk/origin'] = 'svn@2' | 88 fs['trunk/origin'] = 'svn@2' |
| 72 fs['trunk/extra'] = 'dummy' | 89 fs['trunk/extra'] = 'dummy' |
| 73 self._commit_svn(fs) | 90 self._commit_svn(fs) |
| 74 | 91 |
| 75 def populateGit(self): | 92 def populateGit(self): |
| 76 raise NotImplementedError() | 93 raise NotImplementedError() |
| 77 | 94 |
| 78 | 95 |
| 79 class BaseTest(fake_repos.FakeReposTestBase): | 96 class BaseTest(fake_repos.FakeReposTestBase): |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 218 |
| 202 | 219 |
| 203 | 220 |
| 204 if __name__ == '__main__': | 221 if __name__ == '__main__': |
| 205 if '-v' in sys.argv: | 222 if '-v' in sys.argv: |
| 206 DEBUGGING = True | 223 DEBUGGING = True |
| 207 logging.basicConfig(level=logging.INFO) | 224 logging.basicConfig(level=logging.INFO) |
| 208 else: | 225 else: |
| 209 logging.basicConfig(level=logging.ERROR) | 226 logging.basicConfig(level=logging.ERROR) |
| 210 unittest.main() | 227 unittest.main() |
| OLD | NEW |