def test_that_when_putting_policy_succeeds_the_put_policy_method_returns_true(self): ''' tests True bucket updated. ''' result = boto_s3_bucket.put_policy(Bucket='mybucket', Policy='{}', **conn_parameters) self.assertTrue(result['updated'])
def test_that_when_putting_policy_succeeds_the_put_policy_method_returns_true( self): """ tests True bucket updated. """ result = boto_s3_bucket.put_policy(Bucket="mybucket", Policy="{}", **conn_parameters) self.assertTrue(result["updated"])
def test_that_when_putting_policy_fails_the_put_policy_method_returns_error(self): ''' tests False bucket not updated. ''' self.conn.put_bucket_policy.side_effect = ClientError(error_content, 'put_bucket_policy') result = boto_s3_bucket.put_policy(Bucket='mybucket', Policy='{}', **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('put_bucket_policy'))
def test_that_when_putting_policy_fails_the_put_policy_method_returns_error( boto_conn): ''' tests False bucket not updated. ''' boto_conn.put_bucket_policy.side_effect = exceptions.ClientError( error_content, 'put_bucket_policy') result = boto_s3_bucket.put_policy(Bucket='mybucket', Policy='{}', **pytest.conn_parameters) assert result.get( 'error', {}).get('message') == error_message.format('put_bucket_policy')
def test_that_when_putting_policy_fails_the_put_policy_method_returns_error( self): """ tests False bucket not updated. """ self.conn.put_bucket_policy.side_effect = ClientError( error_content, "put_bucket_policy") result = boto_s3_bucket.put_policy(Bucket="mybucket", Policy="{}", **conn_parameters) assert result.get( "error", {}).get("message") == error_message.format("put_bucket_policy")