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

filesize: add support for the ronna and quetta prefixes #142

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bbolli
Copy link
Contributor

@bbolli bbolli commented Aug 19, 2023

No description provided.

@codecov
Copy link

codecov bot commented Aug 19, 2023

Codecov Report

Merging #142 (0804f7e) into main (a1574be) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #142      +/-   ##
==========================================
- Coverage   99.19%   99.19%   -0.01%     
==========================================
  Files           9        9              
  Lines         746      744       -2     
==========================================
- Hits          740      738       -2     
  Misses          6        6              
Flag Coverage Δ
macos-latest 97.58% <100.00%> (-0.01%) ⬇️
ubuntu-latest 97.58% <100.00%> (-0.01%) ⬇️
windows-latest 96.10% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
tests/test_filesize.py 100.00% <ø> (ø)
src/humanize/filesize.py 100.00% <100.00%> (ø)

@bbolli
Copy link
Contributor Author

bbolli commented Aug 19, 2023

Hi! I have no idea how to add a "PR label".

@hugovk
Copy link
Member

hugovk commented Aug 19, 2023

I'll add the PR label, thanks! (And it's an addition not skip.)

Please could you add some test cases so Y, YiB, and YB are still covered somehow?

@hugovk hugovk added the changelog: Added For new features label Aug 19, 2023
@bbolli
Copy link
Contributor Author

bbolli commented Aug 19, 2023

Please could you add some test cases so Y, YiB, and YB are still covered somehow?

Done.

for i, s in enumerate(suffix):
unit = base ** (i + 2)
if abs_bytes < base:
return ("%dB" if gnu else "%d Bytes") % bytes_
Copy link
Member

Choose a reason for hiding this comment

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

Let's keep the previous two if statements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems weird to do the same abs_bytes < basecompare twice...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Added For new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants