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