Exemplo n.º 1
0
 def show_progress(download_t, download_d, upload_t, upload_d):
     if download_d >= download_t and download_d > self._progress_b:
         notifier.write('.')
         self._progress_b = download_t
     elif download_d > self._progress_b + 32768:
         notifier.write('.')
         self._progress_b = download_d
     if download_d > self._progress_hMB + 100 * 1024 * 1024:
         self._progress_hMB = download_d
         notifier.write('\n{} / {}\n'.format(nice_size(self._progress_hMB), nice_size(download_t)))
 def test_nice_size_B(self):
     """ A number below 1 000 B should be expressed in B"""
     nice = nice_size(12)
     assert nice == "12 B", nice
 def test_nice_size_GB(self):
     """ A number below 1 000 000 0000 000 B should be expressed in GB"""
     nice = nice_size(12049000000)
     assert nice == "11.2 GB", nice
 def test_nice_size_MB_after_dot(self):
     """ A number below 1 000 000 0000 B should be expressed in MB"""
     nice = nice_size(12506000)
     assert nice == "11.9 MB", nice
 def test_nice_size_MB(self):
     """ A number below 1 000 000 0000 B should be expressed in MB"""
     nice = nice_size(12056000)
     assert nice == "11.4 MB", nice
 def test_nice_size_KB(self):
     """ A number below 1 000 000 B should be expressed in KB"""
     nice = nice_size(12034)
     assert nice == "11.7 KB", nice