def test_FetchFromCloudStorage_FileNotFound(self): self.mock_cloud_storage.Exists.return_value = False local_path = fetch_build.FetchFromCloudStorage('my_bucket', 'remote/foo.zip', 'local') self.assertIsNone(local_path) self.assertFalse(self.mock_cloud_storage.Get.called)
def test_FetchFromCloudStorage_FileFound(self, mock_os_path_exists): self.mock_cloud_storage.Exists.return_value = True mock_os_path_exists.return_value = True local_path = fetch_build.FetchFromCloudStorage( 'my_bucket', 'remote/foo.zip', 'local') self.assertEqual('local/foo.zip', local_path) self.mock_cloud_storage.Get.assert_called_with( 'my_bucket', 'remote/foo.zip', 'local/foo.zip')