| 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 subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 import unittest | 10 import unittest |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 self.mock_os.path.exists.return_value = False | 60 self.mock_os.path.exists.return_value = False |
| 61 self.mock_os.path.isdir.return_value = False | 61 self.mock_os.path.isdir.return_value = False |
| 62 | 62 |
| 63 self.repo_spec.checkout(self.context) | 63 self.repo_spec.checkout(self.context) |
| 64 | 64 |
| 65 self.mock_subprocess.check_output.assert_any_call( | 65 self.mock_subprocess.check_output.assert_any_call( |
| 66 ['git', 'clone', self.REPO_URL, | 66 ['git', 'clone', self.REPO_URL, |
| 67 os.path.join(self.context.package_dir, 'funny_recipes')]) | 67 os.path.join(self.context.package_dir, 'funny_recipes')]) |
| 68 self.mock_subprocess.check_output.assert_any_call( | 68 self.mock_subprocess.check_output.assert_any_call( |
| 69 ['git', | 69 ['git', |
| 70 '--git-dir', 'repo/root/recipes/.recipe_deps/funny_recipes/.git', | 70 '-C', 'repo/root/recipes/.recipe_deps/funny_recipes', |
| 71 'reset', '-q', '--hard', 'deadbeef']) | 71 'reset', '-q', '--hard', 'deadbeef']) |
| 72 | 72 |
| 73 | 73 |
| 74 class MockProtoFile(package.ProtoFile): | 74 class MockProtoFile(package.ProtoFile): |
| 75 def __init__(self, path, text): | 75 def __init__(self, path, text): |
| 76 super(MockProtoFile, self).__init__(path) | 76 super(MockProtoFile, self).__init__(path) |
| 77 self._text = text | 77 self._text = text |
| 78 | 78 |
| 79 @property | 79 @property |
| 80 def path(self): | 80 def path(self): |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 self.assertEqual(foo_deps.repo_spec.path, '/path/to/local/foo') | 212 self.assertEqual(foo_deps.repo_spec.path, '/path/to/local/foo') |
| 213 | 213 |
| 214 | 214 |
| 215 def load_tests(_loader, tests, _ignore): | 215 def load_tests(_loader, tests, _ignore): |
| 216 tests.addTests(doctest.DocTestSuite(package)) | 216 tests.addTests(doctest.DocTestSuite(package)) |
| 217 return tests | 217 return tests |
| 218 | 218 |
| 219 | 219 |
| 220 if __name__ == '__main__': | 220 if __name__ == '__main__': |
| 221 result = unittest.main() | 221 result = unittest.main() |
| OLD | NEW |