mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 00:04:15 +02:00
[common] fix: size to byte conversion
This commit is contained in:
13
tests/common/test_util.py
Normal file
13
tests/common/test_util.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from bauh.commons.util import size_to_byte
|
||||
|
||||
|
||||
class SizeToByteTest(TestCase):
|
||||
|
||||
def test_must_return_right_number_of_bytes(self):
|
||||
self.assertEqual(round(float('58675.2')), size_to_byte(57.3, 'K'))
|
||||
self.assertEqual(round(float('60083404.8')), size_to_byte(57.3, 'M'))
|
||||
self.assertEqual(round(float('61525406515.2')), size_to_byte(57.3, 'G'))
|
||||
self.assertEqual(round(float('63002016271564.8')), size_to_byte(57.3, 'T'))
|
||||
self.assertEqual(round(float('64514064662082350')), size_to_byte(57.3, 'P'))
|
||||
Reference in New Issue
Block a user