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