Example #1
0
 def test_size_formatting(self):
     self.assertEqual(utils.sizeof_fmt(-1), '-1.0bytes')
     self.assertEqual(utils.sizeof_fmt(0), '0.0bytes')
     self.assertEqual(utils.sizeof_fmt(1000000), '976.6KB')
     self.assertEqual(utils.sizeof_fmt(1000000000000000), '909.5TB')
Example #2
0
	def test_size_formatting(self):
		self.assertEqual(utils.sizeof_fmt(-1), '-1.0bytes')
		self.assertEqual(utils.sizeof_fmt(0), '0.0bytes')
		self.assertEqual(utils.sizeof_fmt(1000000), '976.6KB')
		self.assertEqual(utils.sizeof_fmt(1000000000000000), '909.5TB')
Example #3
0
 def handle_download_progress(self, loaded_block_num, block_size,
                              total_size):
     self.cur_item["progress"] = str(
         utils.sizeof_fmt(loaded_block_num * block_size)) + "/" + str(
             utils.sizeof_fmt(total_size))
Example #4
0
	def handle_download_progress(self, loaded_block_num, block_size, total_size):
		self.cur_item["progress"] = str(utils.sizeof_fmt(loaded_block_num * block_size)) + "/" + str(utils.sizeof_fmt(total_size))