Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow mocking requests to GetOAuth* methods #744

Open
vibridi opened this issue Jun 10, 2020 · 0 comments · May be fixed by #803
Open

Allow mocking requests to GetOAuth* methods #744

vibridi opened this issue Jun 10, 2020 · 0 comments · May be fixed by #803

Comments

@vibridi
Copy link

vibridi commented Jun 10, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants