Exemplo n.º 1
0
 def size(self):
     """
     Return a pretty printing value of the file
     """
     return filesizeformat(self._size)
Exemplo n.º 2
0
def test_filesizeformat():
    assert(filesizeformat(1024, 0) == "1ko")
    assert(filesizeformat(1024, 1) == "1.0ko")
    assert(filesizeformat(1024*1024, 0) == "1Mo")
    assert(filesizeformat(1024*1024, 1) == "1.0Mo")
Exemplo n.º 3
0
 def size(self):
     """
     Return a pretty printing value of the file
     """
     return filesizeformat(self._size)
Exemplo n.º 4
0
 def test_filesizeformat(self):
     self.assertEqual(filesizeformat(1024, 0), "1ko")
     self.assertEqual(filesizeformat(1024, 1), "1.0ko")
     self.assertEqual(filesizeformat(1024*1024, 0), "1Mo")
     self.assertEqual(filesizeformat(1024*1024, 1), "1.0Mo")
Exemplo n.º 5
0
def test_filesizeformat():
    assert (filesizeformat(1024, 0) == "1ko")
    assert (filesizeformat(1024, 1) == "1.0ko")
    assert (filesizeformat(1024 * 1024, 0) == "1Mo")
    assert (filesizeformat(1024 * 1024, 1) == "1.0Mo")