-
Notifications
You must be signed in to change notification settings - Fork 37
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
Remove repetitive/redundant code #88
Conversation
Codecov Report
@@ Coverage Diff @@
## master #88 +/- ##
==========================================
- Coverage 95.09% 95.07% -0.02%
==========================================
Files 7 7
Lines 1284 1280 -4
Branches 115 115
==========================================
- Hits 1221 1217 -4
Misses 43 43
Partials 20 20
Continue to review full report at Codecov.
|
@@ -68,7 +68,7 @@ def test_dump(script_runner): | |||
ret = script_runner.run('tnefparse', '-d', 'tests/examples/two-files.tnef') | |||
assert ret.success | |||
dump = json.loads(ret.stdout) | |||
assert sorted(list(dump.keys())) == ['attachments', 'attributes', 'extended_attributes'] | |||
assert sorted(dump) == ['attachments', 'attributes', 'extended_attributes'] |
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.
Wow, I learned something new.
Following the Zen of Python, I'd still personally prefer:
assert sorted(dump.keys())
even when it is not necessary.
L = len(tozip.get(filename, [])) | ||
if L > 0: | ||
if tozip.get(filename): | ||
length = len(tozip.get(filename)) |
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.
There is no coverage for this line. It would be great to have a test for it.
@@ -45,7 +45,7 @@ def systime(byte_arr, offset=0): | |||
return datetime.utcfromtimestamp((ft - EPOCH_AS_FILETIME) / HUNDREDS_OF_NANOSECONDS) | |||
except: # noqa: E722 | |||
microseconds = ft / 10 | |||
return (datetime(1601, 1, 1) + timedelta(microseconds=microseconds)) | |||
return datetime(1601, 1, 1) + timedelta(microseconds=microseconds) |
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.
There is no coverage for this line. It would be great to have a test for it.
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.
Seems to be non-trivial to come up with a test case #92 (comment)
Rebased changes were merged in #103 |
No description provided.