mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
depot_tools: Run git_cache_test and git_footers_test on windows.
Bug: Some Change-Id: I74eef44bfe3d940c773e548e6d1035dee4cd45ae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1842638 Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org> Reviewed-by: Anthony Polito <apolito@google.com> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This commit is contained in:
committed by
Commit Bot
parent
eeafa0eaec
commit
ab51754cc7
@@ -73,10 +73,8 @@ def CommonChecks(input_api, output_api, tests_to_black_list, run_on_python3):
|
|||||||
r'.*download_from_google_storage_unittest\.py$',
|
r'.*download_from_google_storage_unittest\.py$',
|
||||||
r'.*gclient_scm_test\.py$',
|
r'.*gclient_scm_test\.py$',
|
||||||
r'.*gclient_smoketest\.py$',
|
r'.*gclient_smoketest\.py$',
|
||||||
r'.*git_cache_test\.py$',
|
|
||||||
r'.*git_cl_test\.py$',
|
r'.*git_cl_test\.py$',
|
||||||
r'.*git_common_test\.py$',
|
r'.*git_common_test\.py$',
|
||||||
r'.*git_footers_test\.py$',
|
|
||||||
r'.*git_hyper_blame_test\.py$',
|
r'.*git_hyper_blame_test\.py$',
|
||||||
r'.*git_number_test\.py$',
|
r'.*git_number_test\.py$',
|
||||||
r'.*git_rebase_update_test\.py$',
|
r'.*git_rebase_update_test\.py$',
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ class GitCacheTest(unittest.TestCase):
|
|||||||
|
|
||||||
def git(self, cmd, cwd=None):
|
def git(self, cmd, cwd=None):
|
||||||
cwd = cwd or self.origin_dir
|
cwd = cwd or self.origin_dir
|
||||||
subprocess.check_call(['git'] + cmd, cwd=cwd)
|
git = 'git.bat' if sys.platform == 'win32' else 'git'
|
||||||
|
subprocess.check_call([git] + cmd, cwd=cwd)
|
||||||
|
|
||||||
def testParseFetchSpec(self):
|
def testParseFetchSpec(self):
|
||||||
testData = [
|
testData = [
|
||||||
|
|||||||
@@ -252,9 +252,15 @@ My commit message is my best friend. It is my life. I must master it.
|
|||||||
'sys.stdin',
|
'sys.stdin',
|
||||||
StringIO('line\r\nany spaces\r\n\r\n\r\nFoo: 1\nBar: 2\nFoo: 3'))
|
StringIO('line\r\nany spaces\r\n\r\n\r\nFoo: 1\nBar: 2\nFoo: 3'))
|
||||||
def testToJson(self):
|
def testToJson(self):
|
||||||
with tempfile.NamedTemporaryFile() as tmp:
|
with tempfile.NamedTemporaryFile(delete=False) as tmp:
|
||||||
self.assertEqual(git_footers.main(['--json', tmp.name]), 0)
|
try:
|
||||||
js = json.load(open(tmp.name))
|
# NamedTemporaryFiles must be closed on Windows before being opened
|
||||||
|
# again.
|
||||||
|
tmp.close()
|
||||||
|
self.assertEqual(git_footers.main(['--json', tmp.name]), 0)
|
||||||
|
js = json.load(open(tmp.name))
|
||||||
|
finally:
|
||||||
|
os.remove(tmp.name)
|
||||||
self.assertEqual(js, {'Foo': ['3', '1'], 'Bar': ['2']})
|
self.assertEqual(js, {'Foo': ['3', '1'], 'Bar': ['2']})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user