Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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() |
| OLD | NEW |