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

Side by Side Diff: unittests/package_test.py

Issue 1849563004: Fix: Use -C instead of --git-dir. (Closed) Base URL: https://github.com/luci/recipes-py@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « recipe_engine/package.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/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
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
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()
OLDNEW
« no previous file with comments | « recipe_engine/package.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698