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

Unified Diff: tests/upload_to_google_storage_unittests.py

Issue 1048103002: In upload_to_google_storage, pass -z argument through to gsutil. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Address comments from hinoka Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | upload_to_google_storage.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/upload_to_google_storage_unittests.py
diff --git a/tests/upload_to_google_storage_unittests.py b/tests/upload_to_google_storage_unittests.py
index 24ac6b89c29cacd32bc2730de8e7acc2a9f448b6..3bac038d7402185c3a3a78fff7a4e3f0c4d8159b 100755
--- a/tests/upload_to_google_storage_unittests.py
+++ b/tests/upload_to_google_storage_unittests.py
@@ -48,14 +48,14 @@ class UploadTests(unittest.TestCase):
filenames = [self.lorem_ipsum]
output_filename = '%s.sha1' % self.lorem_ipsum
code = upload_to_google_storage.upload_to_google_storage(
- filenames, self.base_url, self.gsutil, True, False, 1, False)
+ filenames, self.base_url, self.gsutil, True, False, 1, False, 'txt')
self.assertEqual(
self.gsutil.history,
[('check_call',
('ls', '%s/%s' % (self.base_url, self.lorem_ipsum_sha1))),
('check_call',
- ('cp', '-q', filenames[0], '%s/%s' % (self.base_url,
- self.lorem_ipsum_sha1)))])
+ ('cp', '-z', 'txt', filenames[0],
+ '%s/%s' % (self.base_url, self.lorem_ipsum_sha1)))])
self.assertTrue(os.path.exists(output_filename))
self.assertEqual(
open(output_filename, 'rb').read(),
@@ -70,7 +70,7 @@ class UploadTests(unittest.TestCase):
self.gsutil.add_expected(0, '', '')
self.gsutil.add_expected(0, etag_string, '')
code = upload_to_google_storage.upload_to_google_storage(
- filenames, self.base_url, self.gsutil, False, False, 1, False)
+ filenames, self.base_url, self.gsutil, False, False, 1, False, None)
self.assertEqual(
self.gsutil.history,
[('check_call',
@@ -100,7 +100,8 @@ class UploadTests(unittest.TestCase):
False,
False,
self.stdout_queue,
- self.ret_codes)
+ self.ret_codes,
+ None)
expected_ret_codes = [
(20,
'Encountered error on uploading %s to %s/%s\nExpected error message' %
@@ -114,7 +115,7 @@ class UploadTests(unittest.TestCase):
with open(output_filename, 'wb') as f:
f.write(fake_hash) # Fake hash.
code = upload_to_google_storage.upload_to_google_storage(
- filenames, self.base_url, self.gsutil, False, False, 1, True)
+ filenames, self.base_url, self.gsutil, False, False, 1, True, None)
self.assertEqual(
self.gsutil.history,
[('check_call',
@@ -122,7 +123,7 @@ class UploadTests(unittest.TestCase):
('check_call',
('ls', '-L', '%s/%s' % (self.base_url, fake_hash))),
('check_call',
- ('cp', '-q', filenames[0], '%s/%s' % (self.base_url, fake_hash)))])
+ ('cp', filenames[0], '%s/%s' % (self.base_url, fake_hash)))])
self.assertEqual(
open(output_filename, 'rb').read(), fake_hash)
os.remove(output_filename)
@@ -162,4 +163,4 @@ class UploadTests(unittest.TestCase):
if __name__ == '__main__':
- unittest.main()
+ unittest.main()
« no previous file with comments | « no previous file | upload_to_google_storage.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698