depot_tools: Make git_cache Python 3 compatible.
Bug: 984182
Change-Id: Ia413435af80d03dcfa01bb2ab7480cd6a37b4161
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1717496
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
diff --git a/tests/git_cache_test.py b/tests/git_cache_test.py
index afa2b46..399ff0d 100755
--- a/tests/git_cache_test.py
+++ b/tests/git_cache_test.py
@@ -52,7 +52,7 @@
mirror = git_cache.Mirror('test://phony.example.biz')
for fetch_specs, expected in testData:
mirror = git_cache.Mirror('test://phony.example.biz', refs=fetch_specs)
- self.assertItemsEqual(mirror.fetch_specs, expected)
+ self.assertEqual(mirror.fetch_specs, set(expected))
def testPopulate(self):
self.git(['init', '-q'])
@@ -115,13 +115,13 @@
old = git_cache.Mirror._GIT_CONFIG_LOCATION
try:
try:
- os.write(fd, '[cache]\n cachepath="hello world"\n')
+ os.write(fd, b'[cache]\n cachepath="hello world"\n')
finally:
os.close(fd)
git_cache.Mirror._GIT_CONFIG_LOCATION = ['-f', tmpFile]
- self.assertEqual(git_cache.Mirror.GetCachePath(), 'hello world')
+ self.assertEqual(git_cache.Mirror.GetCachePath(), b'hello world')
finally:
git_cache.Mirror._GIT_CONFIG_LOCATION = old
os.remove(tmpFile)