OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2015 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 import codecs | 6 import codecs |
7 import copy | 7 import copy |
8 import json | 8 import json |
9 import os | 9 import os |
10 import sys | 10 import sys |
(...skipping 19 matching lines...) Expand all Loading... |
30 'patch_root': None, | 30 'patch_root': None, |
31 'issue': None, | 31 'issue': None, |
32 'patchset': None, | 32 'patchset': None, |
33 'rietveld_server': None, | 33 'rietveld_server': None, |
34 'gerrit_repo': None, | 34 'gerrit_repo': None, |
35 'gerrit_ref': None, | 35 'gerrit_ref': None, |
36 'gerrit_rebase_patch_ref': None, | 36 'gerrit_rebase_patch_ref': None, |
37 'revision_mapping': {}, | 37 'revision_mapping': {}, |
38 'apply_issue_email_file': None, | 38 'apply_issue_email_file': None, |
39 'apply_issue_key_file': None, | 39 'apply_issue_key_file': None, |
40 'buildspec': False, | |
41 'gyp_env': None, | 40 'gyp_env': None, |
42 'shallow': False, | 41 'shallow': False, |
43 'runhooks': False, | 42 'runhooks': False, |
44 'refs': [], | 43 'refs': [], |
45 'git_cache_dir': '', | 44 'git_cache_dir': '', |
46 'gerrit_reset': None, | 45 'gerrit_reset': None, |
47 } | 46 } |
48 | 47 |
49 | 48 |
50 class MockedPopen(object): | 49 class MockedPopen(object): |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 def tearDown(self): | 184 def tearDown(self): |
186 setattr(bot_update, 'call', self.old_call) | 185 setattr(bot_update, 'call', self.old_call) |
187 setattr(os, 'getcwd', self.old_os_cwd) | 186 setattr(os, 'getcwd', self.old_os_cwd) |
188 delattr(bot_update, 'open') | 187 delattr(bot_update, 'open') |
189 setattr(codecs, 'open', self.old_codecs_open) | 188 setattr(codecs, 'open', self.old_codecs_open) |
190 | 189 |
191 def testBasic(self): | 190 def testBasic(self): |
192 bot_update.ensure_checkout(**self.params) | 191 bot_update.ensure_checkout(**self.params) |
193 return self.call.records | 192 return self.call.records |
194 | 193 |
195 def testBasicBuildspec(self): | |
196 self.params['buildspec'] = bot_update.BUILDSPEC_TYPE( | |
197 container='branches', | |
198 version='1.1.1.1' | |
199 ) | |
200 bot_update.ensure_checkout(**self.params) | |
201 return self.call.records | |
202 | |
203 def testBasicShallow(self): | 194 def testBasicShallow(self): |
204 self.params['shallow'] = True | 195 self.params['shallow'] = True |
205 bot_update.ensure_checkout(**self.params) | 196 bot_update.ensure_checkout(**self.params) |
206 return self.call.records | 197 return self.call.records |
207 | 198 |
208 | 199 |
209 if __name__ == '__main__': | 200 if __name__ == '__main__': |
210 unittest.main() | 201 unittest.main() |
OLD | NEW |