Commit ab51754c authored by Edward Lesmes's avatar Edward Lesmes Committed by Commit Bot

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: 's avatarAnthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent eeafa0ea
......@@ -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'.*gclient_scm_test\.py$',
r'.*gclient_smoketest\.py$',
r'.*git_cache_test\.py$',
r'.*git_cl_test\.py$',
r'.*git_common_test\.py$',
r'.*git_footers_test\.py$',
r'.*git_hyper_blame_test\.py$',
r'.*git_number_test\.py$',
r'.*git_rebase_update_test\.py$',
......
......@@ -28,7 +28,8 @@ class GitCacheTest(unittest.TestCase):
def git(self, cmd, cwd=None):
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):
testData = [
......
......@@ -252,9 +252,15 @@ My commit message is my best friend. It is my life. I must master it.
'sys.stdin',
StringIO('line\r\nany spaces\r\n\r\n\r\nFoo: 1\nBar: 2\nFoo: 3'))
def testToJson(self):
with tempfile.NamedTemporaryFile() as tmp:
self.assertEqual(git_footers.main(['--json', tmp.name]), 0)
js = json.load(open(tmp.name))
with tempfile.NamedTemporaryFile(delete=False) as tmp:
try:
# 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']})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment