| OLD | NEW |
| 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 |
| 11 import unittest | 11 import unittest |
| 12 | 12 |
| 13 # Fixes circular dependency error. |
| 14 import cbuildbot_comm |
| 13 import cbuildbot | 15 import cbuildbot |
| 14 | 16 |
| 15 class CBuildBotTest(mox.MoxTestBase): | 17 class CBuildBotTest(mox.MoxTestBase): |
| 16 | 18 |
| 17 def setUp(self): | 19 def setUp(self): |
| 18 mox.MoxTestBase.setUp(self) | 20 mox.MoxTestBase.setUp(self) |
| 19 # Always stub RunCommmand out as we use it in every method. | 21 # Always stub RunCommmand out as we use it in every method. |
| 20 self.mox.StubOutWithMock(cbuildbot, 'RunCommand') | 22 self.mox.StubOutWithMock(cbuildbot, 'RunCommand') |
| 21 self._test_repos = [['kernel', 'third_party/kernel/files'], | 23 self._test_repos = [['kernel', 'third_party/kernel/files'], |
| 22 ['login_manager', 'platform/login_manager'] | 24 ['login_manager', 'platform/login_manager'] |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 cbuildbot._UprevFromRevisionList(self._buildroot, | 95 cbuildbot._UprevFromRevisionList(self._buildroot, |
| 94 self._test_parsed_string_array) | 96 self._test_parsed_string_array) |
| 95 self.mox.ReplayAll() | 97 self.mox.ReplayAll() |
| 96 cbuildbot._UprevPackages(self._buildroot, self._revision_file, | 98 cbuildbot._UprevPackages(self._buildroot, self._revision_file, |
| 97 self._test_board) | 99 self._test_board) |
| 98 self.mox.VerifyAll() | 100 self.mox.VerifyAll() |
| 99 | 101 |
| 100 | 102 |
| 101 if __name__ == '__main__': | 103 if __name__ == '__main__': |
| 102 unittest.main() | 104 unittest.main() |
| OLD | NEW |