[tests] Add tests for bumblebee.util
Add tests for the utility functions and fix a few embarrassing bugs in the process.
This commit is contained in:
parent
672413c238
commit
846d28714a
2 changed files with 26 additions and 1 deletions
|
@ -23,7 +23,7 @@ def bytefmt(num):
|
|||
if num < 1024.0:
|
||||
return "{:.2f}{}B".format(num, unit)
|
||||
num /= 1024.0
|
||||
return "{:05.2f%}{}GiB".format(num)
|
||||
return "{:.2f}GiB".format(num*1024.0)
|
||||
|
||||
def durationfmt(duration):
|
||||
minutes, seconds = divmod(duration, 60)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue