Add test for repr of named fileobject in tzfile#699
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 |
| - 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.
All new contributors contribute under the dual license, so the name should have a D after it. I can add this myself.
| with self.assertRaises(ValueError): | ||
| tz.tzfile(BytesIO(b'BadFile')) | ||
|
|
||
| def testFilenameFromAttribute(self): |
There was a problem hiding this comment.
This is presumably now a repr test, no?
| @@ -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.
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 <[email protected]>"' -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 - [email protected]. 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