Пример #1
0
    def get_dir_size_test(self):
        """Test the getDirSize."""

        # dev null should have a size == 0
        self.assertEqual(iutil.getDirSize('/dev/null'), 0)

        # incorrect path should also return 0
        self.assertEqual(iutil.getDirSize('/dev/null/foo'), 0)

        # check if an int is always returned
        self.assertIsInstance(iutil.getDirSize('/dev/null'), int)
        self.assertIsInstance(iutil.getDirSize('/dev/null/foo'), int)
Пример #2
0
    def get_dir_size_test(self):
        """Test the getDirSize."""

        # dev null should have a size == 0
        self.assertEqual(iutil.getDirSize('/dev/null'), 0)

        # incorrect path should also return 0
        self.assertEqual(iutil.getDirSize('/dev/null/foo'), 0)

        # check if an int is always returned
        self.assertIsInstance(iutil.getDirSize('/dev/null'), int)
        self.assertIsInstance(iutil.getDirSize('/dev/null/foo'), int)
Пример #3
0
 def spaceRequired(self):
     return Size(iutil.getDirSize("/") * 1024)
 def spaceRequired(self):
     return Size(iutil.getDirSize("/")*1024)
Пример #5
0
 def spaceRequired(self):
     return Size(bytes=iutil.getDirSize(
             os.path.realpath(INSTALL_TREE)) * 1024)