mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-24 02:09:56 +00:00
Merge pull request #1268 from zas/bytes2human_coverage
Increase test coverage of bytes2human
This commit is contained in:
@@ -96,3 +96,8 @@ class Testbytes2human(PicardTestCase):
|
||||
lines = [l.rstrip("\n") for l in f.readlines()]
|
||||
f.close()
|
||||
return lines
|
||||
|
||||
def test_calc_unit(self):
|
||||
self.assertEqual(bytes2human.calc_unit(12456, 1024), (12.1640625, 'KiB'))
|
||||
self.assertEqual(bytes2human.calc_unit(-12456, 1000), (-12.456, 'kB'))
|
||||
self.assertRaises(ValueError, bytes2human.calc_unit, 0, 1001)
|
||||
|
||||
Reference in New Issue
Block a user