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

Feature property fqdn #126

Merged
merged 5 commits into from
May 22, 2017

Conversation

jvanasco
Copy link
Contributor

this is a suggestion for a convenience function

Copy link
Owner

@john-kurkowski john-kurkowski left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! I like it!

Not sure what's going on with Travis. I'll tinker this weekend.

''
"""
if self.domain and self.suffix:
return '.'.join([i for i in [self.subdomain, self.domain, self.suffix] if i])
Copy link
Owner

Choose a reason for hiding this comment

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

Can save 2 lists with '.'.join(i for i in self if i).

Copy link
Owner

Choose a reason for hiding this comment

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

bump

Copy link
Contributor Author

Choose a reason for hiding this comment

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

still working on tests.

i will gladly add this change, but i thought being explicit would be better for reading/maintenance.

@john-kurkowski
Copy link
Owner

Rebase atop latest master. That should fix Travis.

@jvanasco
Copy link
Contributor Author

jvanasco commented May 3, 2017

can you share any info on how you run/setup the tox tests under python 2.7 ?

I tried writing tests and running tox as described in the docs -- and it's collecting 2k+ tests and jamming my box.

looking at the travis build for this, it looks like the python 2.7 tests may be running under python 3 too. i won't have time to investigate more until the weekend, so just wanted to bring it up here in case you know of something that I'm missing.

@john-kurkowski
Copy link
Owner

tox -e <one-env-here>, like this line of the README, runs the test suite for only 1 Python version. That works well for me for local development. That'll give you a much faster feedback loop. It's not bulletproof. That's okay. Once you push your work, Travis will run the entire test suite matrix.

@jvanasco
Copy link
Contributor Author

jvanasco commented May 3, 2017 via email

@john-kurkowski
Copy link
Owner

Hmm. I'm not seeing that.

$ python --version                                                                                                                        
Python 2.7.13
 ~/S…/tldextract $ tox -e py27-requests-current -- --collect-only 2>&1  | grep collected                                                                   
collected 46 items
 ~/S…/tldextract $ tox -e py36-requests-current -- --collect-only 2>&1  | grep collected                                                                   
collected 34 items

@jvanasco
Copy link
Contributor Author

jvanasco commented May 4, 2017

thanks for humoring me on this. tox seems to be broken on this build of OSX. i'm running 2.7 tests on an ubuntu box fine now.

replaced the inner loop on `fqdn()` function with `self` as it's just the namedtuple instance's fields in order
@jvanasco
Copy link
Contributor Author

Ok. changes made and tests added.

Sorry for the travis overload - I did most of my work in a different branch and merged back to avoid issues... then had to reorganize the tests to make them pass.

The test reorganization is pretty simple. Tox doesn't want to see more than 5 args per function. instead of changing the rule, I slightly altered the way assert_extract works. Now the URL is first (instead of last) and the "expected" elements are a tuple. This makes reading the tests much easier.

@john-kurkowski
Copy link
Owner

Wow! So exhaustive! I'd have been fine with the doctest but this is great. 😋 Thank you!

@john-kurkowski john-kurkowski merged commit d8ee44a into john-kurkowski:master May 22, 2017
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.

None yet

2 participants