Skip to content

Allow mocking requests to GetOAuth* methods #744

@vibridi

Description

@vibridi

In version v0.4.0 I used to be able to mock requests to GetOAuth* methods by overriding the SLACK_API variable: slack.SLACK_API = "some-test-url"

Now this isn't possible anymore, because these methods build the request with APIURL which is a constant:

// GetOAuthResponseContext retrieves OAuth response with custom context
func GetOAuthResponseContext(...) (resp *OAuthResponse, err error) {
        ...
	if err = postForm(ctx, client, APIURL+"oauth.access", ...); err != nil {
	...
}

Please would you consider adding back some support for overriding the url? Alternatively, is there a better way to test this?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions