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

Side by Side Diff: tests/download_from_google_storage_unittests.py

Issue 16072023: Change download_from_google_storage.py to not run gsutil config when receiving a 403 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « download_from_google_storage.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 (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 # pylint: disable=W0212 5 # pylint: disable=W0212
6 6
7 """Unit tests for download_from_google_storage.py.""" 7 """Unit tests for download_from_google_storage.py."""
8 8
9 import optparse 9 import optparse
10 import os 10 import os
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 self.assertEqual(code, 0) 75 self.assertEqual(code, 0)
76 self.assertEqual(err, '') 76 self.assertEqual(err, '')
77 77
78 def test_gsutil_version(self): 78 def test_gsutil_version(self):
79 gsutil = download_from_google_storage.Gsutil(GSUTIL_DEFAULT_PATH) 79 gsutil = download_from_google_storage.Gsutil(GSUTIL_DEFAULT_PATH)
80 _, _, err = gsutil.check_call('version') 80 _, _, err = gsutil.check_call('version')
81 err_lines = err.splitlines() 81 err_lines = err.splitlines()
82 self.assertEqual(err_lines[0], 'gsutil version 3.25') 82 self.assertEqual(err_lines[0], 'gsutil version 3.25')
83 self.assertEqual( 83 self.assertEqual(
84 err_lines[1], 84 err_lines[1],
85 'checksum ce71ac982f1148315e7fa65cff2f83e8 (OK)') 85 'checksum 010822c61d38d70ac23600bc955fccf5 (OK)')
iannucci 2013/06/04 05:15:15 why did this change? Is this the checksum of downl
86 86
87 def test_get_sha1(self): 87 def test_get_sha1(self):
88 lorem_ipsum = os.path.join(self.base_path, 'lorem_ipsum.txt') 88 lorem_ipsum = os.path.join(self.base_path, 'lorem_ipsum.txt')
89 self.assertEqual( 89 self.assertEqual(
90 download_from_google_storage.get_sha1(lorem_ipsum), 90 download_from_google_storage.get_sha1(lorem_ipsum),
91 '7871c8e24da15bad8b0be2c36edc9dc77e37727f') 91 '7871c8e24da15bad8b0be2c36edc9dc77e37727f')
92 92
93 def test_get_md5(self): 93 def test_get_md5(self):
94 lorem_ipsum = os.path.join(self.base_path, 'lorem_ipsum.txt') 94 lorem_ipsum = os.path.join(self.base_path, 'lorem_ipsum.txt')
95 self.assertEqual( 95 self.assertEqual(
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 ('check_call', 273 ('check_call',
274 ('ls', input_filename)), 274 ('ls', input_filename)),
275 ('check_call', 275 ('check_call',
276 ('cp', '-q', input_filename, output_filename))] 276 ('cp', '-q', input_filename, output_filename))]
277 self.assertEqual(self.gsutil.history, expected_calls) 277 self.assertEqual(self.gsutil.history, expected_calls)
278 self.assertEqual(code, 0) 278 self.assertEqual(code, 0)
279 279
280 280
281 if __name__ == '__main__': 281 if __name__ == '__main__':
282 unittest.main() 282 unittest.main()
OLDNEW
« no previous file with comments | « download_from_google_storage.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698