-
Notifications
You must be signed in to change notification settings - Fork 523
Add test for repr of named fileobject in tzfile #699
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
Conversation
|
As a general rule I try not to test the private interface, so I prefer not to test what I think for other tzinfo types this is tested by seeing the effect it has on the |
|
Hi Paul, Makes sense - I've changed the code to use the repr in the same way it is done in other test functions, for example: testTzwinRepr |
AUTHORS.md
Outdated
| - Brock Mendel <jbrockmendel@MASKED> (gh: @jbrockmendel) **R** | ||
| - Brook Li (gh: @absreim) **D** | ||
| - Carlos <carlosxl@MASKED> | ||
| - Chris van den Berg (gh: bergvca) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All new contributors contribute under the dual license, so the name should have a D after it. I can add this myself.
dateutil/test/test_tz.py
Outdated
| with self.assertRaises(ValueError): | ||
| tz.tzfile(BytesIO(b'BadFile')) | ||
|
|
||
| def testFilenameFromAttribute(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is presumably now a repr test, no?
changelog.d/699.misc.rst
Outdated
| @@ -0,0 +1 @@ | |||
| Added unittest to check if tz's objects "_filename" attribute is equall to the "name" object of an input fileobject. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer an accurate description of the changes.
631f847 to
5aabc77
Compare
|
@Bergvca Are you aware that your Github associates git commits with users based on their e-mail address, so if this is merged as-is, I don't think you'll show up in the Github UI under "Contributors", nor will it show up on your activity summary (at least this was the case last time I looked into it). If you care about Github UI but want to mask your real e-mail address, you can set your e-mail to |
|
By the way, I've gone in and cleaned up the history a bit, so make sure to do a force pull before making any further changes. If you don't care about the github credit, I can merge as-is, otherwise I'll just run: git fetch upstream master
git rebase --exec 'git commit --amend --no-edit -n --author="Chris van den Berg <Bergvca@users.noreply.github.com>"' -i upstream/masterTo rewrite the history with the new e-mail address and merge the results. |
|
Hi Paul, No I wasn't aware - I've set it to - Bergvca@users.noreply.github.com. You can do the merge as described: Thanks! P.s. I've started working on this during the NY Sprint, hope to add some more coverage in the future :) |
Checks if the tzinfo object's _filename attribute is equal to the name attribute of the input file object.
The original unit test tested the value of _filename, this instead tests the publicly observable effect of _filename, the repr of the object. Add changelog for this test.
Include dual license acknowledgement
5aabc77 to
1ed7c7b
Compare
|
@Bergvca Thanks for your contribution! |
Summary of changes
Added unittest to check if tz's objects "_filename" attribute is equal to the "name" object of an input fileobject.
Closes
N/a - related to Get coverage to 100% (#521)
Pull Request Checklist