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

Ensure query string is included when building _api URL. Fixes #672 #673

Merged
merged 4 commits into from
Jan 28, 2017
Merged

Ensure query string is included when building _api URL. Fixes #672 #673

merged 4 commits into from
Jan 28, 2017

Conversation

dprothero
Copy link
Contributor

@dprothero dprothero commented Jan 27, 2017

Fixes Issue #672

@@ -52,7 +52,7 @@ class TestGitHubCore(helper.UnitHelper):
last_modified = datetime.now().strftime(
'%a, %d %b %Y %H:%M:%S GMT'
)
url = 'https://api.github.com/foo'
url = 'https://api.github.com/foo?bar=1'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a separate test class for this test and revert this change.

@sigmavirus24
Copy link
Owner

Also looks like this will break some of our recorded cassettes. Once you've addressed my review feedback above, I'll push new cassettes to your branch.

@dprothero
Copy link
Contributor Author

OK, I assume that's what the build failures are regarding?

@sigmavirus24
Copy link
Owner

Yep. That's why those are failing. Thanks for updating. I'll push a new commit with updated cassettes here in a few.

@dprothero
Copy link
Contributor Author

Ha, a bunch of my automation has broken as well. Would it be better if we didn't add the query if it was just "ref=master"?

@sigmavirus24
Copy link
Owner

I'd rather not special case this, personally. How did your automation break?

@dprothero
Copy link
Contributor Author

I fake the GitHub API to make a bunch of our tests run faster. So, for example, if it was expecting a GET to https://api.github.com/repos/twilio/api-snippets-dev/contents/lookups/lookup-get-basic-example-1/meta.json, it is now https://api.github.com/repos/twilio/api-snippets-dev/contents/lookups/lookup-get-basic-example-1/meta.json?ref=master

Not a problem to fix the tests, just thought I'd check. Agreed it's not pretty to add that special case.

@sigmavirus24
Copy link
Owner

Agreed it's not pretty to add that special case.

Just also not practical. _api is defined (and works for) every object. So special casing behaviour for one seems a bit silly.

Once these tests pass, we should be good to merge this. Thanks for finding, reporting, and fixing this @dprothero !

Now that we include the query string in the URL, we need to update our
cassettes and some of our other unit tests. This also fixes our tox.ini
to work with newer versions of tox (i.e., passenv)
@sigmavirus24 sigmavirus24 merged commit b0b27c4 into sigmavirus24:develop Jan 28, 2017
@dprothero dprothero deleted the fix-issue-672 branch January 30, 2017 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants