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

Fix uplink.Url by checking url type (fixes #164) #165

Merged
merged 4 commits into from
Aug 18, 2019

Conversation

cognifloyd
Copy link
Contributor

Fixes #164 .

Changes proposed in this pull request:

  • Check the type so build() isn't called on an already resolved string URL.

Attention: @prkumar

@codecov
Copy link

codecov bot commented Jun 16, 2019

Codecov Report

Merging #165 into master will decrease coverage by 0.18%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #165      +/-   ##
==========================================
- Coverage     100%   99.81%   -0.19%     
==========================================
  Files          41       41              
  Lines        2170     2173       +3     
  Branches      173      173              
==========================================
- Hits         2170     2169       -1     
- Misses          0        3       +3     
- Partials        0        1       +1
Impacted Files Coverage Δ
uplink/builder.py 100% <ø> (ø) ⬆️
uplink/arguments.py 100% <100%> (ø) ⬆️
uplink/helpers.py 100% <100%> (ø) ⬆️
uplink/commands.py 100% <100%> (ø) ⬆️
uplink/utils.py 93.33% <0%> (-6.67%) ⬇️
uplink/clients/aiohttp_.py 97.87% <0%> (-2.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff72f3f...193ffc4. Read the comment docs.

@prkumar
Copy link
Owner

prkumar commented Jun 20, 2019

@cognifloyd Thanks for addressing this! Changes look good. Seems that there are some coverage impacts, though. We'll probably need an integration test for this one.

I think another way to solve this would be to address this in arguments.py; as you pointed out in #164, this is where the Url is setting the string:

uplink/uplink/arguments.py

Lines 680 to 682 in 0d29483

def _modify_request(cls, request_builder, value):
"""Updates request url."""
request_builder.url = value

We could update this to:

    def _modify_request(cls, request_builder, value): 
        """Updates request url.""" 
        request_builder.url = utils.URIBuilder(value)

This should result in no coverage changes and unblock your changes from being merged in. However, we should keep a follow-up task to add an integration test for this one before release.

@cognifloyd
Copy link
Contributor Author

It looks like the tests are wrong. They're testing for a string, but now it's a URIBuilder instance.
I'll have to look at how to modify the tests later.

@prkumar prkumar added this to the v0.10.0 milestone Aug 10, 2019
@prkumar prkumar merged commit 48d1952 into prkumar:master Aug 18, 2019
@cognifloyd cognifloyd mentioned this pull request Feb 4, 2020
@prkumar prkumar mentioned this pull request Feb 8, 2020
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.

using uplink.Url results in an AttributeError
2 participants