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

TST: More Unit tests #831

Merged
merged 12 commits into from
Apr 28, 2022
Merged

TST: More Unit tests #831

merged 12 commits into from
Apr 28, 2022

Conversation

MartinThoma
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Apr 27, 2022

Codecov Report

Merging #831 (1c024a1) into main (fd775d3) will increase coverage by 3.42%.
The diff coverage is 89.85%.

@@            Coverage Diff             @@
##             main     #831      +/-   ##
==========================================
+ Coverage   77.20%   80.62%   +3.42%     
==========================================
  Files          12       12              
  Lines        3540     3572      +32     
  Branches      830      821       -9     
==========================================
+ Hits         2733     2880     +147     
+ Misses        590      511      -79     
+ Partials      217      181      -36     
Impacted Files Coverage Δ
PyPDF2/pdf.py 82.21% <83.33%> (ø)
PyPDF2/generic.py 84.60% <92.15%> (+17.08%) ⬆️

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 cb32323...1c024a1. Read the comment docs.

@pytest.mark.parametrize("value, expected", [(b"true", b"true"), (b"false", b"false")])
def test_boolean_object(value, expected):
stream = BytesIO(value)
BooleanObject.readFromStream(stream)
Copy link
Member

@MasterOdin MasterOdin Apr 27, 2022

Choose a reason for hiding this comment

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

We should have an assert on what this returns? Unless the point of the test is just validating it doesn't mutate the input stream beyond reading through it...

Could also add a test case for b"fals" since that looks like it'll parse the same as b"false" and perhaps useful to capture that info? We may also with to capture that it leaves the incoming stream at the end of it?

Copy link
Member Author

Choose a reason for hiding this comment

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

We should have an assert on what this returns?

Good point, I completely missed that it returns something 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

capture that it leaves the incoming stream at the end of it

Also a good idea. I've just added it 👍

@MartinThoma MartinThoma merged commit fcd1aed into main Apr 28, 2022
@MartinThoma MartinThoma deleted the misc branch April 28, 2022 08:39
MartinThoma added a commit that referenced this pull request Apr 28, 2022
* BUG: StopIteration got deprecated in Python 3.7, see PEP 479
* STY: Use property decorator

Co-authored-by: Matthew Peveler <matt.peveler@gmail.com>
VictorCarlquist pushed a commit to VictorCarlquist/PyPDF2 that referenced this pull request Apr 29, 2022
* BUG: StopIteration got deprecated in Python 3.7, see PEP 479
* STY: Use property decorator

Co-authored-by: Matthew Peveler <matt.peveler@gmail.com>
MartinThoma added a commit that referenced this pull request May 1, 2022
Robustness (ROB):
-  Handle missing destinations in reader (#840)
-  warn-only in readStringFromStream (#837)
-  Fix corruption in startxref or xref table (#788 and #830)

Documentation (DOC):
-  Project Governance (#799)
-  History of PyPDF2
-  PDF feature/version support (#816)
-  More details on text parsing issues (#815)

Developer Experience (DEV):
-  Add benchmark command to Makefile
-  Ignore IronPython parts for code coverage (#826)

Maintenance (MAINT):
-  Split pdf module (#836)
-  Separated CCITTFax param parsing/decoding (#841)
-  Update requirements files

Testing (TST):
-  Use external repository for larger/more PDFs for testing (#820)
-  Swap incorrect test names (#838)
-  Add test for PdfFileReader and page properties (#835)
-  Add tests for PyPDF2.generic (#831)
-  Add tests for utils, form fields, PageRange (#827)
-  Add test for ASCII85Decode (#825)
-  Add test for FlateDecode (#823)
-  Add test for filters.ASCIIHexDecode (#822)

Code Style (STY):
-  Apply pre-commit (black, isort) + use snake_case variables (#832)
-  Remove debug code (#828)
-  Documentation, Variable names (#839)

Full Changelog: 1.27.9...1.27.10
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.

2 participants