Пример #1
0
 def report(self):
     return report_template.format(
         geomname=self.sys_api.get('geomname'),
         mediasize=human_readable_size(int(self.sys_api.get('mediasize'))),
         rotational=int(self.sys_api.get('rotationrate')) != 0,
         mode=self.sys_api.get('mode'),
         descr=self.sys_api.get('descr'))
Пример #2
0
 def test_terabytes(self):
     result = disk.human_readable_size(81.2 * 1024 * 1024 * 1024 * 1024)
     assert result == '81.20 TB'
Пример #3
0
 def test_gigabytes(self):
     result = disk.human_readable_size(8.19 * 1024 * 1024 * 1024)
     assert result == '8.19 GB'
Пример #4
0
 def test_megabytes(self):
     result = disk.human_readable_size(800 * 1024 * 1024)
     assert result == '800.00 MB'
Пример #5
0
 def test_kilobytes(self):
     result = disk.human_readable_size(800 * 1024)
     assert result == '800.00 KB'
Пример #6
0
 def test_bytes(self):
     result = disk.human_readable_size(800)
     assert result == '800.00 B'
Пример #7
0
 def test_petabytes(self):
     result = disk.human_readable_size(9.23*1024*1024*1024*1024*1024)
     assert result == '9.23 PB'
Пример #8
0
 def test_terabytes(self):
     result = disk.human_readable_size(81.2*1024*1024*1024*1024)
     assert result == '81.20 TB'
Пример #9
0
 def test_gigabytes(self):
     result = disk.human_readable_size(8.19*1024*1024*1024)
     assert result == '8.19 GB'
Пример #10
0
 def test_megabytes(self):
     result = disk.human_readable_size(800*1024*1024)
     assert result == '800.00 MB'
Пример #11
0
 def test_kilobytes(self):
     result = disk.human_readable_size(800*1024)
     assert result == '800.00 KB'
Пример #12
0
 def test_bytes(self):
     result = disk.human_readable_size(800)
     assert result == '800.00 B'