Exemple #1
0
 def test_units(self):
     assert human_readable_file_size((10**3)**0) == '1 B'
     assert human_readable_file_size((10**3)**1) == '1 kB'
     assert human_readable_file_size((10**3)**2) == '1 MB'
     assert human_readable_file_size((10**3)**3) == '1 GB'
     assert human_readable_file_size((10**3)**4) == '1 TB'
     assert human_readable_file_size((10**3)**5) == '1 PB'
     assert human_readable_file_size((10**3)**6) == '1 EB'
Exemple #2
0
 def test_999b(self):
     assert human_readable_file_size(999) == '999 B'
Exemple #3
0
 def test_1kb(self):
     assert human_readable_file_size(1000) == '1 kB'
     assert human_readable_file_size(1024) == '1.024 kB'
Exemple #4
0
 def test_1023b(self):
     assert human_readable_file_size(1023) == '1.023 kB'
Exemple #5
0
 def test_100b(self):
     assert human_readable_file_size(100) == '100 B'