def METHOD_NAME(make_stubber, make_unique_name, error_code):
    iam_stubber = make_stubber(role_wrapper.iam.meta.client)
    role_name = make_unique_name('role-')
    policy_arn = 'arn:aws:test:::test-policy-arn'
    iam_stubber.stub_detach_role_policy(role_name, policy_arn, error_code=error_code)
    if error_code is None:
        role_wrapper.detach_policy(role_name, policy_arn)
    else:
        with pytest.raises(ClientError) as exc_info:
            role_wrapper.detach_policy(role_name, policy_arn)
        assert exc_info.value.response['Error']['Code'] == error_code