Example #1
0
 def test_hbytes_TB(self):
     testnumber = 1024.0 ** 4 + 5
     result = hbytes(testnumber)
     self.assertEqual(result, '1.0 TB')
Example #2
0
 def test_hbytes_GB(self):
     testnumber = 1024.0 ** 3 + 5
     result = hbytes(testnumber)
     self.assertEqual(result, '1.0 GB')
Example #3
0
 def test_hbytes_KB(self):
     testnumber = 1024.0 + 5
     result = hbytes(testnumber)
     self.assertEqual(result, '1.0 KB')
Example #4
0
 def test_hbytes_MB(self):
     testnumber = 1024.0 ** 2 + 5
     result = hbytes(testnumber)
     self.assertEqual(result, '1.0 MB')
Example #5
0
 def test_hbytes(self):
     testnumber = 5
     result = hbytes(testnumber)
     self.assertEqual(result, '5.0 bytes')