Merge pull request #1268 from zas/bytes2human_coverage

Increase test coverage of bytes2human
This commit is contained in:
Laurent Monin
2019-09-08 10:57:46 +02:00
committed by GitHub

View File

@@ -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)