| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 import unittest | 6 import unittest |
| 7 | 7 |
| 8 from catapult_base import cloud_storage |
| 8 from telemetry.unittest_util import system_stub | 9 from telemetry.unittest_util import system_stub |
| 9 from telemetry.util import cloud_storage | |
| 10 | 10 |
| 11 | 11 |
| 12 def _FakeFindGsutil(): | 12 def _FakeFindGsutil(): |
| 13 return 'fake gsutil path' | 13 return 'fake gsutil path' |
| 14 | 14 |
| 15 def _FakeReadHash(_): | 15 def _FakeReadHash(_): |
| 16 return 'hashthis!' | 16 return 'hashthis!' |
| 17 | 17 |
| 18 def _FakeCalulateHashMatchesRead(_): | 18 def _FakeCalulateHashMatchesRead(_): |
| 19 return 'hashthis!' | 19 return 'hashthis!' |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 orig_run_command = cloud_storage._RunCommand | 156 orig_run_command = cloud_storage._RunCommand |
| 157 def AssertCorrectRunCommandArgs(args): | 157 def AssertCorrectRunCommandArgs(args): |
| 158 self.assertEqual(expected_args, args) | 158 self.assertEqual(expected_args, args) |
| 159 cloud_storage._RunCommand = AssertCorrectRunCommandArgs | 159 cloud_storage._RunCommand = AssertCorrectRunCommandArgs |
| 160 expected_args = ['cp', 'gs://bucket1/remote_path1', | 160 expected_args = ['cp', 'gs://bucket1/remote_path1', |
| 161 'gs://bucket2/remote_path2'] | 161 'gs://bucket2/remote_path2'] |
| 162 try: | 162 try: |
| 163 cloud_storage.Copy('bucket1', 'bucket2', 'remote_path1', 'remote_path2') | 163 cloud_storage.Copy('bucket1', 'bucket2', 'remote_path1', 'remote_path2') |
| 164 finally: | 164 finally: |
| 165 cloud_storage._RunCommand = orig_run_command | 165 cloud_storage._RunCommand = orig_run_command |
| OLD | NEW |