| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 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 doctest | 6 import doctest |
| 7 import os | 7 import os |
| 8 import sys | 8 import sys |
| 9 import unittest | 9 import unittest |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 self.mock_os.path.exists.return_value = False | 57 self.mock_os.path.exists.return_value = False |
| 58 self.mock_os.path.isdir.return_value = False | 58 self.mock_os.path.isdir.return_value = False |
| 59 | 59 |
| 60 self.repo_spec.checkout(self.context) | 60 self.repo_spec.checkout(self.context) |
| 61 | 61 |
| 62 self.mock_subprocess.check_call.assert_any_call( | 62 self.mock_subprocess.check_call.assert_any_call( |
| 63 ['git', 'clone', self.REPO_URL, | 63 ['git', 'clone', self.REPO_URL, |
| 64 os.path.join(self.context.package_dir, 'funny_recipes')], | 64 os.path.join(self.context.package_dir, 'funny_recipes')], |
| 65 cwd=None) | 65 cwd=None) |
| 66 self.mock_subprocess.check_call.assert_any_call( | 66 self.mock_subprocess.check_call.assert_any_call( |
| 67 ['git', 'reset', '-q', '--hard', 'deadbeef'], | 67 ['git', |
| 68 cwd='repo/root/recipes/.recipe_deps/funny_recipes') | 68 '--git-dir', 'repo/root/recipes/.recipe_deps/funny_recipes/.git', |
| 69 'reset', '-q', '--hard', 'deadbeef'], cwd=None) |
| 69 | 70 |
| 70 | 71 |
| 71 class MockProtoFile(package.ProtoFile): | 72 class MockProtoFile(package.ProtoFile): |
| 72 def __init__(self, path, text): | 73 def __init__(self, path, text): |
| 73 super(MockProtoFile, self).__init__(path) | 74 super(MockProtoFile, self).__init__(path) |
| 74 self._text = text | 75 self._text = text |
| 75 | 76 |
| 76 @property | 77 @property |
| 77 def path(self): | 78 def path(self): |
| 78 return self._path | 79 return self._path |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 self.assertEqual(foo_deps.repo_spec.path, '/path/to/local/foo') | 210 self.assertEqual(foo_deps.repo_spec.path, '/path/to/local/foo') |
| 210 | 211 |
| 211 | 212 |
| 212 def load_tests(_loader, tests, _ignore): | 213 def load_tests(_loader, tests, _ignore): |
| 213 tests.addTests(doctest.DocTestSuite(package)) | 214 tests.addTests(doctest.DocTestSuite(package)) |
| 214 return tests | 215 return tests |
| 215 | 216 |
| 216 | 217 |
| 217 if __name__ == '__main__': | 218 if __name__ == '__main__': |
| 218 result = unittest.main() | 219 result = unittest.main() |
| OLD | NEW |