def test_that_when_describing_bucket_on_client_error_it_returns_error(self): ''' Tests describing parameters failure ''' self.conn.get_bucket_acl.side_effect = ClientError(error_content, 'get_bucket_acl') result = boto_s3_bucket.describe(Bucket='mybucket', **conn_parameters) self.assertTrue('error' in result)
def test_that_when_describing_bucket_it_returns_the_dict_of_properties_returns_false(self): ''' Tests describing parameters if bucket does not exist ''' self.conn.get_bucket_acl.side_effect = not_found_error result = boto_s3_bucket.describe(Bucket='mybucket', **conn_parameters) self.assertFalse(result['bucket'])
def test_that_when_describing_bucket_on_client_error_it_returns_error( self): """ Tests describing parameters failure """ self.conn.get_bucket_acl.side_effect = ClientError( error_content, "get_bucket_acl") result = boto_s3_bucket.describe(Bucket="mybucket", **conn_parameters) self.assertTrue("error" in result)
def test_that_when_describing_bucket_it_returns_the_dict_of_properties_returns_false( self, ): """ Tests describing parameters if bucket does not exist """ self.conn.get_bucket_acl.side_effect = not_found_error result = boto_s3_bucket.describe(Bucket="mybucket", **conn_parameters) assert not result["bucket"]
def test_that_when_describing_bucket_it_returns_the_dict_of_properties_returns_true(self): ''' Tests describing parameters if bucket exists ''' for key, value in six.iteritems(config_ret): getattr(self.conn, key).return_value = deepcopy(value) result = boto_s3_bucket.describe(Bucket='mybucket', **conn_parameters) self.assertTrue(result['bucket'])
def test_that_when_describing_bucket_it_returns_the_dict_of_properties_returns_true(self): ''' Tests describing parameters if bucket exists ''' for key, value in config_ret.iteritems(): getattr(self.conn, key).return_value = deepcopy(value) result = boto_s3_bucket.describe(Bucket='mybucket', **conn_parameters) self.assertTrue(result['bucket'])
def test_that_when_describing_bucket_on_client_error_it_returns_error( boto_conn): ''' Tests describing parameters failure ''' boto_conn.get_bucket_acl.side_effect = exceptions.ClientError( error_content, 'get_bucket_acl') result = boto_s3_bucket.describe(Bucket='mybucket', **pytest.conn_parameters) assert 'error' in result
def test_that_when_describing_bucket_it_returns_the_dict_of_properties_returns_true( self, ): """ Tests describing parameters if bucket exists """ for key, value in six.iteritems(config_ret): getattr(self.conn, key).return_value = deepcopy(value) result = boto_s3_bucket.describe(Bucket="mybucket", **conn_parameters) self.assertTrue(result["bucket"])
def test_that_when_describing_bucket_it_returns_the_dict_of_properties_returns_true( boto_conn): ''' Tests describing parameters if bucket exists ''' for key, value in six.iteritems(config_ret): getattr(boto_conn.conn, key).return_value = deepcopy(value) result = boto_s3_bucket.describe(Bucket='mybucket', **pytest.conn_parameters) assert result['bucket']