Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: bin/cbuildbot_unittest.py

Issue 3159047: Fix case where there is nothing to uprev. (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bin/cbuildbot.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Unittests for cbuildbot. Needs to be run inside of chroot for mox.""" 7 """Unittests for cbuildbot. Needs to be run inside of chroot for mox."""
8 8
9 import __builtin__ 9 import __builtin__
10 import mox 10 import mox
(...skipping 11 matching lines...) Expand all
22 ['login_manager', 'platform/login_manager'] 22 ['login_manager', 'platform/login_manager']
23 ] 23 ]
24 self._test_cros_workon_packages = \ 24 self._test_cros_workon_packages = \
25 'chromeos-base/kernel\nchromeos-base/chromeos-login\n' 25 'chromeos-base/kernel\nchromeos-base/chromeos-login\n'
26 self._test_board = 'test-board' 26 self._test_board = 'test-board'
27 self._buildroot = '.' 27 self._buildroot = '.'
28 self._test_dict = {'kernel' : ['chromos-base/kernel', 'dev-util/perf'], 28 self._test_dict = {'kernel' : ['chromos-base/kernel', 'dev-util/perf'],
29 'cros' : ['chromos-base/libcros'] 29 'cros' : ['chromos-base/libcros']
30 } 30 }
31 self._test_string = "kernel.git@12345test cros.git@12333test" 31 self._test_string = "kernel.git@12345test cros.git@12333test"
32 self._test_string += " crosutils.git@blahblah"
32 self._revision_file = 'test-revisions.pfq' 33 self._revision_file = 'test-revisions.pfq'
33 self._test_parsed_string_array = [ 34 self._test_parsed_string_array = [
34 ['chromeos-base/kernel', '12345test'], 35 ['chromeos-base/kernel', '12345test'],
35 ['dev-util/perf', '12345test'], 36 ['dev-util/perf', '12345test'],
36 ['chromos-base/libcros', '12345test'] 37 ['chromos-base/libcros', '12345test']
37 ] 38 ]
38 39
39 def testParseRevisionString(self): 40 def testParseRevisionString(self):
40 """Test whether _ParseRevisionString parses string correctly.""" 41 """Test whether _ParseRevisionString parses string correctly."""
41 return_array = cbuildbot._ParseRevisionString(self._test_string, 42 return_array = cbuildbot._ParseRevisionString(self._test_string,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 cbuildbot._UprevFromRevisionList(self._buildroot, 94 cbuildbot._UprevFromRevisionList(self._buildroot,
94 self._test_parsed_string_array) 95 self._test_parsed_string_array)
95 self.mox.ReplayAll() 96 self.mox.ReplayAll()
96 cbuildbot._UprevPackages(self._buildroot, self._revision_file, 97 cbuildbot._UprevPackages(self._buildroot, self._revision_file,
97 self._test_board) 98 self._test_board)
98 self.mox.VerifyAll() 99 self.mox.VerifyAll()
99 100
100 101
101 if __name__ == '__main__': 102 if __name__ == '__main__':
102 unittest.main() 103 unittest.main()
OLDNEW
« no previous file with comments | « bin/cbuildbot.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698