def test_tb(self): self.assertEqual(1000000000000, crhumanize.dehumanize_readable_filesize('1.00TB')) self.assertEqual(55560000000000, crhumanize.dehumanize_readable_filesize('55.56TB'))
def test_kb(self): self.assertEqual(1000, crhumanize.dehumanize_readable_filesize('1KB')) self.assertEqual(999000, crhumanize.dehumanize_readable_filesize('999KB'))
def test_mb(self): self.assertEqual(1000000, crhumanize.dehumanize_readable_filesize('1.0MB')) self.assertEqual(55600000, crhumanize.dehumanize_readable_filesize('55.6MB'))
def test_less_than_kb(self): self.assertEqual(0, crhumanize.dehumanize_readable_filesize('0B')) self.assertEqual(999, crhumanize.dehumanize_readable_filesize('999B'))