예제 #1
0
 def test_removes_cli_error_event(self):
     mock_events = Mock()
     mock_client = Mock()
     mock_client.meta.events = mock_events
     utils.remove_cli_error_event(mock_client)
     mock_events.unregister.assert_called_with(
         'after-call', unique_id='awscli-error-handler')
예제 #2
0
 def test_removes_cli_error_event(self):
     mock_events = Mock()
     mock_client = Mock()
     mock_client.meta.events = mock_events
     utils.remove_cli_error_event(mock_client)
     mock_events.unregister.assert_called_with(
         'after-call', unique_id='awscli-error-handler')
예제 #3
0
 def _create_client(self, region_name):
     """Creates an Amazon S3 client for the given region name"""
     if region_name not in self._client_cache:
         client = self._session.create_client('s3', region_name)
         # Remove the CLI error event that prevents exceptions.
         remove_cli_error_event(client)
         self._client_cache[region_name] = client
     return self._client_cache[region_name]
예제 #4
0
 def _create_client(self, region_name):
     """Creates an Amazon S3 client for the given region name"""
     if region_name not in self._client_cache:
         client = self._session.create_client('s3', region_name)
         # Remove the CLI error event that prevents exceptions.
         remove_cli_error_event(client)
         self._client_cache[region_name] = client
     return self._client_cache[region_name]